Skip to content

Instantly share code, notes, and snippets.

View hooptie45's full-sized avatar
:shipit:
Focusing

Shaun Hannah hooptie45

:shipit:
Focusing
  • Bloomberg
  • Washington, DC
View GitHub Profile
require 'flexgen/model_builder'
require 'metamodel/as'
include ASMetaModel
def auto_build
FlexGen::ModelBuilder.build(ASMetaModel) do
app "App", :base => "com.test" do
# Models
actor "Customer" do
attribute "first_name", :view_type => "String"
attribute "last_name", :view_type => "String"
@hooptie45
hooptie45 / friend-buy.io
Created August 19, 2011 08:18
Friend Buy Redis
> SET server:name "bidja"
"OK"
> SADD item:item1:bidders 123456
true
> SADD item:item1:bidders 333333
true
> SADD item:item1:bidders 555555
true
> SADD item:item1:bidders 123456
true
@hooptie45
hooptie45 / dsl.rb
Created August 19, 2011 11:19
FlexGen
app "App", :base => "com.test" do
# Models
actor "Customer" do
attribute "first_name", :view_type => "String"
attribute "last_name", :view_type => "String"
# Customer Signals
sig "New"
sig "Destroy"
end
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!
#
@hooptie45
hooptie45 / rails31init.md
Created October 14, 2011 22:47 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
(defn test []
)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore.js"></script>
<script src="http://backbonejs.org/backbone.js"></script>
<script src="http://coffeescript.org/extras/coffee-script.js"></script>
Lomo PBR yr, freegan VHS butcher you probably haven't heard of them thundercats cardigan terry richardson. Aesthetic craft beer marfa chambray Austin, biodiesel freegan wolf jean shorts single-origin coffee cred viral gentrify williamsburg. Sartorial VHS iphone, before they sold out gluten-free +1 farm-to-table raw denim. Etsy tofu craft beer, organic hoodie aesthetic lomo 8-bit photo booth viral you probably haven't heard of them chambray carles. Twee american apparel marfa terry richardson, wes anderson lomo messenger bag VHS. Messenger bag 8-bit twee, biodiesel etsy readymade trust fund mustache wayfarers organic artisan. Terry richardson etsy wes anderson, vinyl fanny pack pitchfork viral mcsweeney's.
+1 put a bird on it photo booth, mixtape vinyl letterpress scenester. Carles quinoa beard banh mi, squid locavore trust fund shoreditch before they sold out PBR salvia raw denim stumptown biodiesel photo booth. Wolf vegan Austin sartorial. Next level banh mi banksy terry richardson, seitan lo-fi mustache. T