Skip to content

Instantly share code, notes, and snippets.

View atmos's full-sized avatar
🌴
On vacation

Corey Donohoe atmos

🌴
On vacation
View GitHub Profile
@atmos
atmos / gist:30502
Created November 30, 2008 19:02 — forked from Oshuma/gist:30473
def create_article(options = {})
create_and_authenticate_user
Article.all.destroy!
request(resource(:articles), :method => "POST",
:params => { :article => { :title => 'Title',
:content => 'Blog post.' }})
end
def create_and_authenticate_user
User.all.destroy!
@atmos
atmos / merb.rb
Created June 9, 2009 16:46 — forked from lenary/merb.rb
module Hancock
module Helpers
module Merb
begin
::Merb::Authentication.user_class = User
class ::Merb::Authentication
def fetch_user(session_user_id)
Merb::Authentication.user_class.get(session[:user_id])
@atmos
atmos / sinatra_app.rb
Created December 13, 2009 23:35 — forked from bhb/sinatra_app.rb
require 'rubygems'
require 'sinatra'
require 'rack/test'
module XModule
def some_method
"x"
end
end
// original gist from http://gist.github.com/392869
// got a request from a friend to help make this code work
// the previous bug was closing the db handle incorrectly in the callbacks
// run it like this
// // node foo.js
// // curl -vv "http://localhost:3000/37signals%20-%20Mark%20Imbriaco.mov"
// // curl -vv "http://localhost:3000/37signals%20-%20Mark%20Imbriaco.mov"
var kiwi = require('kiwi'),
sys = require('sys')
@atmos
atmos / test.js
Created May 21, 2010 00:37 — forked from pedro/test.js
var sys = require('sys'),
http = require('http'),
spawn = require('child_process').spawn
function passAll(callback) {
callback()
}
function passAfterRequest(callback) {
var node = http.createClient(80, 'nodejs.org');
# What is the best way to get it to put out a, b, c
# without erroring about the superclass. The module
# inclusion order should not matter. In other words,
# I should be able to include A then B or B then A
# and either way all the letters a, b, and c are
# printed out (though not necessarily in that exact order)
require 'pp'
module Z
@atmos
atmos / app.rb
Created June 19, 2010 19:17 — forked from paul/app.rb
module Things
get '/' do
'Hello!'
end
end
module Keister
class App < Sinatra::Base
include Things
app.error (err,req,res,next)->
if process.env.RACK_ENV == 'production'
hoptoad.key = 'hoptoadkey'
hoptoad.notify(err)
res.render 'error.ejs', 500
Note these instructions are all based on the mightyOhm articles. This is a little bit different because I wanted to get alsa sound working (instead of dsp) so that I could overlay effects
and background sound simultaneously.
What to do
==========
install mightyohm trx
setup network and wireless
vi /etc/opkg.conf
src/gz snapshots http://192.168.24.104/mightyohm
opkg update
var fs = require('fs')
, path = require('path')
, base64 = require('base64')
var body = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAKIAeYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+kxbCMxpmNRGIwRyf9o5OCxyRtzuBfDE5Jzm/b6dA5JVFVwxJKkgEMzsApAUlgOPmBCgqxG4MSsMiGJRuBOFZjwc5Y5PK