This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = ?; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var $f; | |
| $f = function $f() { | |
| var types = Array.prototype.slice.call(arguments); | |
| var returnType; | |
| function defineReturn(val) { | |
| returnType = val; | |
| return defineFn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function typeCheck(obj, type) { | |
| if (type === undefined || type === null) { | |
| return obj === type; | |
| } | |
| else { | |
| return obj.constructor === type; | |
| } | |
| } | |
| function check() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Horrible = function() { | |
| function horribleInit() { | |
| } | |
| // Stupid shit | |
| horribleInit(); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(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"); |