Skip to content

Instantly share code, notes, and snippets.

View lukesutton's full-sized avatar

Luke Matthew Sutton lukesutton

View GitHub Profile
@lukesutton
lukesutton / elixir.rb
Created May 28, 2012 02:33 — forked from huffman/elixir.rb
Elixir 0.5.0 Homebrew recipe
# Install this recipe with:
# brew install --HEAD https://gist.github.com/raw/2816905/daafa0d7e3c5da694401fac138aae340a9ead157/elixir.rb
require 'formula'
class Elixir < Formula
homepage 'http://elixir-lang.org/'
head 'https://github.com/elixir-lang/elixir.git', :tag => '0.5.0'
depends_on 'erlang'
// A specific controller and action
$S.init('users.index', function() {});
// All actions in Users
$S.init('users.*', function() {});
// All new actions in all controllers
$S.init('*.new', function() {});
// Everything all the time
class Migration
@grants = {}
def self.grant(name, &blk)
if block_given?
proxy = ConfigProxy.new(&blk)
grant = Grant.new(proxy.options)
@grants[name] = grant
else
@grants[name]
Dolt.procedure do
name :get_jammy
single_parition true
partition_info "Reservation.FlightInfo", 0
sql :number_of_seats, %{
SELECT NumOfSeats, COUNT(ReserveID) AS SeatsInUse
FROM Flight AS F, Reservation AS R
WHERE F.FlightID=R.FlightID AND R.FlightID = ?;
}
class App::Users
include Oooh::Controller
GET :index, '/' do
render 'index'
end
GET :show, '/:id', do |id|
user = DB::User.find(id)
render 'show', :user => user
(function() {
var $f;
$f = function $f() {
var types = Array.prototype.slice.call(arguments);
var returnType;
function defineReturn(val) {
returnType = val;
return defineFn;
Prove: require('simple-test').Prove
exports.examples: new Prove 'Examples', ->
@beforeAll ->
puts 'run before everything'
@longCat: 'medium'
@test 'Long cat is not that long', ->
assert @longCat is 'long'
function typeCheck(obj, type) {
if (type === undefined || type === null) {
return obj === type;
}
else {
return obj.constructor === type;
}
}
function check() {
var Horrible = function() {
function horribleInit() {
}
// Stupid shit
horribleInit();
};
$(document).ready(function() {
module("Router");
var routes = Bongst.Router.setup(function(r) {
r.map("default", "/:controller/:id/:action");
r.map("extra", "/admin/:action").to({jelly: "drop"});
});
test("Basic route", function() {
var match = routes.match("/users/1/edit");