Skip to content

Instantly share code, notes, and snippets.

View nrobinson2000's full-sized avatar

Nate Robinson nrobinson2000

View GitHub Profile
@nrobinson2000
nrobinson2000 / manifest.json
Created December 27, 2020 21:23
Workbench/neopo manifest.json for redbearduo
{
"version": "1.0.0",
"toolchains": [
{
"firmware": "deviceOS@source",
"compilers": "gcc-arm@5.3.1",
"debuggers": "openocd@0.11.2-adhoc6ea4372.0",
"platforms": [1],
"scripts": "buildscripts@1.9.2",
"tools": "buildtools@1.1.1"
@nrobinson2000
nrobinson2000 / comfortable-swipe.conf
Created September 8, 2019 17:03
Configuration for comfortable-swipe
# Comfortable Swipe converts touchpad swipe gestures to keyboard commands. You
# may edit this configuration file if you have different keyboard shortcuts
# that you would like to use. You can ignore a gesture by commenting out with
# a pound(#) symbol.
#
# Refer to https://www.linux.org/threads/xdotool-keyboard.10528/ for a list of
# keycodes you can use.
#################
# MISCELLANEOUS #
@nrobinson2000
nrobinson2000 / cehs-install.sh
Last active December 6, 2018 20:47
Script to install po on CEHS computers
#!/bin/bash -li
echo "
Are you ready to install po-util?
Please be sure to follow any prompts or instructions
during the installation process."
read -rp "ENTER / CTRL-C: "
echo "
#include "Particle.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
SerialLogHandler usbLogHandler(LOG_LEVEL_TRACE);
#define CLOUD_TIMEOUT 60000 // how many ms are acceptable for lost cloud connection (needs to be > 45sec)
#define CLOUD_MAXRETRY 5 // how many unsuccessful connection attempts befor a System.reset
#define SECOND_MS 1000
@nrobinson2000
nrobinson2000 / README.md
Created September 4, 2018 18:38
Install Linux Mint on Razer Blade 15
@nrobinson2000
nrobinson2000 / .conkyrc
Last active October 1, 2018 19:21
My .conkyrc
# Conky configuration
background no
use_xft yes
xftfont Monospace:size=9
xftalpha 0
out_to_console no
update_interval 1
total_run_times 0
own_window yes
own_window_type desktop
@nrobinson2000
nrobinson2000 / ParticleDetect.sh
Created April 6, 2018 23:59 — forked from jenschr/ParticleDetect.sh
Script to automate the setup of multiple Particle devices (Photon, P1, P0, Electron)
#!/bin/sh
# Basic setup script for devices
# Works on OSX + should also work for Unix.
# Users of Windows 10 (or higher) can likely use the builtin Ubuntu install.
#
# We need to do the following:
# 1. Query the computer for the relevant USB port
# 2. Set the device to listening mode (if required)
# 3. Query the device for the deviceID
@nrobinson2000
nrobinson2000 / getLibURL.sh
Created August 21, 2017 03:30
Get the GitHub URL for a Particle library
#!/bin/bash
getLibURL()
{
TOKEN="$(cat ~/.particle/particle.config.json | grep 'token' | grep -oE '([0-Z])\w+')"
DATA=$(curl -sLH "Authorization: Bearer $TOKEN" "https://api.particle.io/v1/libraries/$1" | json_pp)
LIBURL=$(echo "$DATA" | grep "url" | grep -oE '"((?:\\.|[^"\\])*)"' | grep "http" | tr -d '"')
}
getLibURL "$1"
@nrobinson2000
nrobinson2000 / httpGetJSON.js
Created April 23, 2017 15:58
Get a JSON object from API request
function httpGetJSON(url) // Get JSON object from an API
{
var xhr = new XMLHttpRequest();
xhr.open("GET", url, false); // false for synchronous request
xhr.send( null );
return JSON.parse(xhr.responseText);
}
// Example from https://api.github.com/
// Get current_user_url