Skip to content

Instantly share code, notes, and snippets.

View mathias's full-sized avatar

Matt Gauger mathias

View GitHub Profile
@mathias
mathias / raster's drawbot
Created January 13, 2011 21:15
I made it possible to run the DrawBot by feeding it an array. Haven't tested since I don't have servos.
/*
* Drawbot.pde
*/
#include <Servo.h>
Servo leftServo;
Servo rightServo;
int servoPinL = 9;
puts "Hello world!"
@mathias
mathias / gist:1067345
Created July 6, 2011 14:23
.ssh directory setup for future reference
chmod 700 .ssh
chmod 600 .ssh/authorized_keys
Reference:
This file is readable by more than just you. Newer versions of ssh see this, recongize it as a security hole, and prevent you from doing something stupid. Lesson Learned: Make sure that the files in .ssh are writable only by you, on both machines, and non-executable by anyone.
^ reference http://joey.ubuntu-rocks.org/blog/2008/06/08/ssh-authorized_keys-permissions-or-why-ssh-is-smarter-than-you/
$ ruby yml_vs_json.rb
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
--------------------------------------------------------------------
YAML.load: 1.3839
YAML.load (Psych): 5.7482
Marshal.load: 0.3741
to_yaml: 4.8386
to_load (Psych): 12.0944
to_json: 0.3005
Marshal.dump: 0.4385
#!/usr/bin/env bash
source $(dirname $0)/scriptlib
TMP=/tmp/_git_hamlize_tmp
TARGET_FILES="$*"
REQUIRED_GEMS="hpricot ruby_parser"
function move_and_hamlize {
for F in $TARGET_FILES
map <silent> <C-s> :NERDTree<CR><C-w>l:NERDTreeFind<CR>
autocmd User Rails Rnavcommand sass app/stylesheets -suffix=.sass -default=partials/_page
autocmd User Rails Rnavcommand coffee app/coffee -suffix=.coffee
autocmd User Rails Rnavcommand cell app/cells
autocmd User Rails Rnavcommand cellview app/cells -glob=**/* -suffix=.html.haml
set autoindent
set backupdir=~/.vimbackupdir,~/tmp,~/,.
set directory=~/.vimbackupdir,~/tmp,~/,.
require 'rubygems'
require 'faker'
require 'net/http'
domain = "gmail.com"
10000.times do
user_name = Faker::Internet.free_email
http = Net::HTTP.new(domain)
Feature: CRUD actions for program
As a user of the site, I can perform standard CRUD actions on programs
Background: I am logged into the site
Given I am a user with username "test" and password "password"
And I sign in as "test/password"
And I am on the programs index
Scenario: Create a new program
$().ready(function() {
// don't show me trending topics
$("<style type='text/css'>.trends-inner{ display: none }</style>").appendTo("head");
// don't show me promoted tweets
$("<style type='text/css'>p.promo{ display: none }</style>").appendTo("head");
// don't recommend that I follow anybody
$("<style type='text/css'>.user-rec-component{ display: none }</style>").appendTo("head");
$ clisp
i
. . . . I . i i i ooooo o ooooooo ooooo ooooo
I I I I I I I I I 8 8 8 8 8 o 8 8
I I \ `+' / I I 8 8 8 8 8 8
I \ `-+-' / I 8 8 8 ooooo 8oooo
\ `-__|__-' / 8 8 8 8 8
`--___|___--' 8 o 8 8 o 8 8
| ooooo 8oooooo ooo8ooo ooooo 8
--------+--------