Skip to content

Instantly share code, notes, and snippets.

View rubyist's full-sized avatar

Scott Barron rubyist

View GitHub Profile
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "light_ws2812.h"
#include <string.h>
#define LEDSPERSEG 1
#define LEDSEGMENTS 7
#define DIGITS 4
#define LEDSPERDIGIT LEDSPERSEG * LEDSEGMENTS
@rubyist
rubyist / gist:9533110
Created March 13, 2014 17:38
keybase.md
### Keybase proof
I hereby claim:
* I am rubyist on github.
* I am rubyist (https://keybase.io/rubyist) on keybase.
* I have a public key whose fingerprint is 1B23 8186 02E1 D85F 61B7 AC94 B351 D529 7399 1682
To claim this, I am signing this object:
#!/usr/bin/env ruby
require 'rubygems'
require 'parseconfig'
config = ParseConfig.new('.git/config')
url = config["remote \"origin\""]["url"]
if url =~ /^git@/
url = "https://#{url.sub!(/git@/, '').sub!(':', '/').sub!('.git', '')}"
else
package main
import (
"bufio"
"errors"
"fmt"
"os"
"strconv"
"strings"
"time"
require 'rubygems'
require 'growl_glue'
GrowlGlue::Autotest.initialize do |config|
config.title :success => 'YOU ROCK'
config.title :failure => 'YOU SUCK'
config.sound :success => 'tpir-dings.wav'
config.sound :failure => 'tpirhorns.wav'
config.sound :location => '/Users/scott'
end
Index: app/src/processing/app/Preferences.java
===================================================================
--- app/src/processing/app/Preferences.java (revision 5415)
+++ app/src/processing/app/Preferences.java (working copy)
@@ -154,9 +154,13 @@
// start by loading the defaults, in case something
// important was deleted from the user prefs
try {
- load(Base.getLibStream("preferences.txt"));
+ if (commandLinePrefs != null) {
;; My conventions for Cocoa are Foo.h - but the auto-mode-alist
;; searches with sensitivity based on case-fold-search, this function
;; will check for that and set Foo.h to objc-mode while keeping foo.h
;; in c-mode.
(defun determine-header-objc-ness ()
(let (sensitivity)
(setq sensitivity case-fold-search)
(setq case-fold-search nil)
(if (string-match "^[A-Z].*\\.h$" (buffer-name))
(objc-mode)
(defun butterfly ()
"Use butterflies to flip the desired bit on the drive platter.
Open hands and let the delicate wings flap once. The disturbance
ripples outward, changing the flow of the eddy currents in the
upper atmosphere. These cause momentary pockets of higher-pressure
air to form, which act as lenses that deflect incoming cosmic rays,
focusing them to strike the drive platter and flip the desired bit.
You can type `M-x butterfly C-M-c' to run it. This is a permuted
variation of `C-x M-c M-butterfly' from url `http://xkcd.com/378/'."
(interactive)
on opening folder this_folder
tell application "Safari"
activate
tell application "System Events"
tell process "Safari"
click menu item "New Tab" of menu "File" of menu bar 1
end tell
end tell
set the URL of document 1 to "file:///Users/foo/bar.html"
end tell
# spec -cfs user_spec.rb
require 'rubygems'
require 'aasm'
require 'active_record'
require 'fileutils'
FileUtils.rm_f('dbfile')
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "dbfile")
ActiveRecord::Schema.create_table(:users) do |t|
t.string :name