Skip to content

Instantly share code, notes, and snippets.

View stinethebean3's full-sized avatar
๐Ÿ™

Christine stinethebean3

๐Ÿ™
View GitHub Profile
@stinethebean3
stinethebean3 / Twinkle.ino
Last active December 22, 2015 01:59
Twinkle LEDs for Space Canvas
#include <Adafruit_NeoPixel.h>
#define PIN 12
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
@stinethebean3
stinethebean3 / cowsay.sh
Created August 12, 2014 04:45
Makes a picture of a cow say what you want
#!/bin/bash
count=${#*}
for word in $* ; do
count=$(($count+${#word}))
done
echo -n " "
for i in $(eval echo {0..$count}); do
echo -n _;
done
@stinethebean3
stinethebean3 / beer.sh
Created August 12, 2014 05:01
Writes the lyrics to the Bottles of Beer on the Wall song
#!/bin/bash
i=99 s=s
while [ $i -gt 0 ]; do
p="bottle"
p2="of beer"
p3="on the wall"
echo $i $p$s $p2 $p3
echo $i $p$s $p2
@stinethebean3
stinethebean3 / screenshot.sh
Last active March 24, 2016 08:44
Simple utility to save a screenshot, upload to your server, and copies url to clipboard to paste wherever.
#!/bin/bash
# Steps to install:
# 1. Install imagemagick (For example: apt-get install imagemagick)
# 2. Save this script to a folder in your $PATH (For example: $HOME/bin/ss)
# 3. Update variables below as appropriate
SSH_USERNAME="stinethebean"
SSH_HOSTNAME="admin.hashbang.sh"
PUBLIC_URL="stinethebean.hashbang.sh"
@stinethebean3
stinethebean3 / adafruitnfc.txt
Created September 13, 2015 23:38
Adafruit PN532 read UID example
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_PN532.h>
#define PN532_IRQ (2)
#define PN532_RESET (3) // Not connected by default on the NFC Shield
Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);
void setup(void) {
@stinethebean3
stinethebean3 / gpg-agent.plist
Created March 13, 2017 03:21
OSX launchd unit for auto starting gpg-agent script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/Users/cvick/.local/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>Label</key>
@stinethebean3
stinethebean3 / fizzbuzz.js
Last active July 21, 2017 04:43
Fizzbuzz
#!/bin/node
//Array.from(Array(101).keys()).forEach(function(i) {
for (var i = 0; i < 101; i++) {
if ((i % 3) == 0) {
console.log("fizz");
}
if ((i % 5) == 0) {
console.log("buzz");
}
@stinethebean3
stinethebean3 / ath.sh
Created January 31, 2018 06:47
Let's you know if Bitcoin is at an all time high (ath) or not
#!/bin/bash
ath_api="https://api.coindesk.com/v1/bpi/historical/close.json"
ath_args="?start=2013-01-01&end=$(date '+%Y-%m-%d')"
ath=$(\
curl -s ${ath_api}${ath_args} | \
jq '.bpi| to_entries[] | .value' | \
sort -nr | \
head -n 1
)
@stinethebean3
stinethebean3 / viewgsvuploads.sh
Created November 14, 2018 06:50
Get list of Google Street View uploads for a Matterport account in a given date range
#!/bin/bash
# Usage:
# $ export TOKEN=abcdefg
# $ viewgsvuploads.sh $orgID 2018-10-1 2018-10-31
token="$TOKEN"
organization="$1"
created_gte="${2}T00:00:00%2B00:00"
created_lt="${3}T00:00:00%2B00:00"
@stinethebean3
stinethebean3 / ergodox_infinity.json
Created May 8, 2019 06:01
Default layout for ergodox infinity keyboard
{"keyboard":"ergodox_infinity","keymap":"ergodox_infinity_layout_ergodox_mine","layout":"LAYOUT_ergodox","layers":[["KC_EQL","KC_1","KC_2","KC_3","KC_4","KC_5","KC_ESC","KC_BSLS","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_NO","KC_TAB","KC_A","KC_S","KC_D","KC_F","KC_G","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","MO(1)","KC_LGUI","KC_GRV","KC_BSLS","KC_LEFT","KC_RGHT","KC_LCTL","KC_LALT","KC_HOME","KC_BSPC","KC_DEL","KC_END","KC_NO","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_LBRC","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_RBRC","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","MO(1)","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT","KC_RGUI","KC_RALT","KC_RCTL","KC_PGUP","KC_PGDN","KC_ENT","KC_SPC"],["KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_NO","KC_NO","KC_NO","KC_MS_U","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_MS_L","KC_MS_D","KC_MS_R","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO"