Skip to content

Instantly share code, notes, and snippets.

View nrobinson2000's full-sized avatar

Nate Robinson nrobinson2000

View GitHub Profile
@nrobinson2000
nrobinson2000 / bashrc
Created December 5, 2016 13:11
bashrc
export GPG_TTY=$(tty)
export PS1="\[$(tput setaf 6)\]\[$(tput bold)\]\u\[$(tput sgr0)\]\[$(tput setaf 5)\]\[$(tput bold)\]@\[$(tput setaf 7)\]\[$(tput bold)\]\h:\[$(tput sgr0)\]\[$(tput setaf 4)\]\[$(tput bold)\]\w $ \[$(tput sgr0)\]"
export EDITOR="nano"
export PARTICLE_DEVELOP=1
alias spark="particle"
alias ls="ls -G"
alias la="ls -la"
alias lh="ls -lah"
alias l="ls"
alias update="~/auto-git.sh"
@nrobinson2000
nrobinson2000 / slack-bot.json
Created November 13, 2016 14:29
Sample webhook for publishing to slack
{
"eventName": "slack-bot",
"url": " https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ",
"requestType": "POST",
"json": {
"text": "{{PARTICLE_EVENT_VALUE}}",
"username": "particle-bot",
"icon_emoji": ":level_slider:"
},
"mydevices": true
@nrobinson2000
nrobinson2000 / nrobinson2000-particle.js
Last active May 16, 2020 11:49
Call particle functions and get particle variables from a device in javascript
var token = "YOUR_PARTICLE_ACCESS_TOKEN";
var device = "YOUR_PARTICLE_DEVICEID";
function httpPost(url, params)
{
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
//Send the proper header information along with the request
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
Verifying that "nrobinson2000.id" is my Blockstack ID. https://onename.com/nrobinson2000
@nrobinson2000
nrobinson2000 / setup.sh
Created October 4, 2016 23:00
Alpha phase setup script for Raspberry Pi
#!/bin/bash
echo "Raspberry Pi Alpha Setup tool:"
echo
echo "Installing Screen..."
sudo apt-get install screen
echo
read -rp "Enter your Device ID: " deviceID
echo "$deviceID" > device_id.txt
@nrobinson2000
nrobinson2000 / particle-and-ifttt.json
Created September 18, 2016 14:47
Hombridge config.json for creating Particle and IFTTT accessories
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:39",
"port": 51826,
"pin": "031-45-154"
},
"description": "This configuration file creates a Particle platform with 4 accessories, and an IFTTT platform with 1 accessory.",
"platforms": [
{
@nrobinson2000
nrobinson2000 / bitcoin-usd-converter.py
Created June 15, 2016 09:07
bitcoin-usd-converter.py
import urllib2
def turnFloat(x):
result = ""
for i in range(len(x)):
if str(x[i]).isdigit():
result = result + x[i]
if x[i] == ".":
result = result + x[i]
return float(result)

Keybase proof

I hereby claim:

  • I am nrobinson2000 on github.
  • I am nrobinson2000 (https://keybase.io/nrobinson2000) on keybase.
  • I have a public key ASCnFD3Xt1cApan6y7_UwLk3oJ1A5C14Cab2itHH6gKtkwo

To claim this, I am signing this object:

@nrobinson2000
nrobinson2000 / ifttt-maker.json
Last active September 15, 2017 11:43
Particle IFTTT maker channel webhook example
{
"eventName": "name-of-particle-event",
"url": "https://maker.ifttt.com/trigger/NAME_OF_IFTTT_EVENT/with/key/PUT_YOUR_IFTTT_KEY_HERE",
"requestType": "POST",
"json": {
"value1": "{{SPARK_EVENT_VALUE}}"
},
"mydevices": true
}
Verifying that +nrobinson2000 is my blockchain ID. https://onename.com/nrobinson2000