Skip to content

Instantly share code, notes, and snippets.

View spilth's full-sized avatar
👽
spilth.org

Brian Kelly spilth

👽
spilth.org
View GitHub Profile
@spilth
spilth / gist:8b40c130d1bd857ee76f
Created October 20, 2014 02:24
littleBits EasyJam w/Scale Selector
const int noteSelector = A0;
const int oscillator = 5;
const int scaleSelector = A1;
const int barGraph = 9;
int scaleA[] = {0, 2, 4, 5, 7, 9, 11, 12, 12 + 2, 12 + 4, 12 + 5, 12 + 7, 12 + 9, 12 + 11, 12 + 12};
int scaleB[] = {0, 2, 3, 5, 7, 8, 10, 12, 12 + 2, 12 + 3, 12 + 5, 12 + 7, 12 + 8, 12 + 10, 12 + 12};
int scaleC[] = {0, 2, 5, 7, 9, 12, 12 + 2, 12 + 5, 12 + 7, 12 + 9, 12 + 12};
int scaleD[] = {0, 3, 5, 6, 7, 10, 12, 12 + 3, 12 + 5, 12 + 6, 12 + 7, 12 + 10, 12 + 12};
@spilth
spilth / cloudbit_client.rb
Last active August 29, 2015 14:08
CloudBit Client - run`gem install rest_client` first.
# USAGE:
# require './cloudbit_client'
# client = CloudBitClient.new('your_api_token', 'your_device_id')
# client.output(100)
# client.output(50, 3000)
require 'rest_client'
class CloudBitClient
def initialize(api_token, device_id)
require 'arduino_firmata'
require 'l8'
l8 = L8::Smartlight.new "/dev/ttyACM0"
puts "Connected to L8"
l8.clear_matrix
l8.set_brightness(:low)
arduino = ArduinoFirmata.connect "/dev/ttyACM1"
puts "Connected to Arduino"
body {
background-color: #FFFFFF;
color: #000;
margin: 2em;
}
body {
font-size: 18px;
line-height: 22px;
font-family: "Helvetica", "Arial", sans-serif;
}

cards.csv

name,type,image,description,quote
Landmaster,Vehicle,landmaster.png
"The Interceptor","Vehicle",interceptor.png,Blah blah blah,"The last of the V8 Interceptors... a piece of history!"
180,"Manuver",,You do a 180,Yeeeee-hawwww!

deckrb

@spilth
spilth / install_dash_gem_docs.rb
Created August 25, 2016 12:50
Installs the Dash docs for all the Ruby Gems in your Gemfile
#!/usr/bin/env ruby
#
# Prerequisites:
# gem install gemnasium-parser
require 'gemnasium/parser'
def remove_docless_gems(gemfile)
# rails-assets gems don't have docs and cause Dash to crash
gemfile.dependencies.reject { |dependency| dependency.name.start_with?("rails-assets") }

Keybase proof

I hereby claim:

  • I am spilth on github.
  • I am spilth (https://keybase.io/spilth) on keybase.
  • I have a public key whose fingerprint is A650 37B6 043B 912F 278C E15D B5F8 2588 8BDF 987E

To claim this, I am signing this object:

@spilth
spilth / python-cheatsheet.md
Created August 30, 2017 13:50
Python Cheatsheet

Python Cheatsheet

Python Version Manager

Use Homebrew to install pyenv and pyenv-virtualenv:

$ brew install pyenv
$ brew install pyenv-virtualenv