Skip to content

Instantly share code, notes, and snippets.

View grantmichaels's full-sized avatar

grantmichaels grantmichaels

View GitHub Profile
// one global css object
//
var css;
(function(){
css = function(){
// static data
//
this.data =
http_path = "/" # Root of project when deployed
css_dir = "public/stylesheets"
sass_dir = "public/stylesheets/sass"
images_dir = "images"
javascripts_dir = "javascripts"
relative_assets = true
var child_process = require('child_process'),
sys = require('sys'),
net = require('net'),
netBinding = process.binding('net');
var fd = netBinding.socket('tcp4');
netBinding.bind(fd, 8080);
netBinding.listen(fd, 128);
for (var i = 0; i < 4; i++) {
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
require 'rubygems'
require 'sinatra'
get '/' do
"hello world"
end
require "rubygems"
require "gratr"
require "gratr/dot"
# 1 -> 2 -> 3
# |-> 6 -> |-> 4 -> 5 -> 2
# 2 -> 4 -> 5
dg = GRATR::Digraph[1,2, 2,3, 2,4, 4,5, 6,4, 1,6]
require "rubygems"
require 'mq'
EM.run {
amq = MQ.new
EM.add_periodic_timer(1) { amq.queue("noises").publish("moo") }
}
require "rubygems"
require "json"
class Schema
attr_accessor :hsh
def initialize(h={})
@hsh = {}
case h
when Hash
h.each {|k,v| self[k] = v}
-module(web_utils).
-include ("beehive.hrl").
-include ("http.hrl").
-compile (export_all).
% Private
convert_to_struct(RawData) ->
lists:map(fun({BinKey, BinVal}) ->
Key = misc_utils:to_atom(BinKey),
Val = misc_utils:to_list(BinVal),
# sinatra/thin based proxy
require 'rubygems'
require 'sinatra'
require 'nokogiri'
require 'open-uri'
require 'redis'
require 'digest/md5'
$KCODE = 'u' if RUBY_VERSION < '1.9'
before do