Public Gists by lukesutton

Gravatar
Wed Nov 18 18:06:11 -0800 2009
1
2
3
$(document).ready(function() {
  module("Router");
  
Gravatar
Wed Oct 28 19:45:36 -0700 2009
1
2
3
var _ = {};
 
_.head = function(array) {
Gravatar
Thu Sep 17 17:23:17 -0700 2009
1
2
3
ArgumentError at /
odd number of arguments for Hash
 
Gravatar
Wed Aug 12 17:56:35 -0700 2009
1
2
3
var Bongst = Bongst || {};
 
Bongst.App = function(config) {
Gravatar
Tue Aug 11 21:27:51 -0700 2009
1
2
3
// Waits for and handles changes to the hash in the address. When it detects
// a change, it will grab the new path and run any registered stacks.
var BongstAvenue = function() {
Gravatar
Tue Aug 04 05:42:24 -0700 2009
1
2
3
// TODO: clone the toOptions rather than just copying it's references
// TODO: add verify on route to allow custom regexes to be used
// TODO: allow optional entries to be specified
Gravatar
Thu May 07 00:17:27 -0700 2009
1
2
3
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
 
Gravatar
Sun May 03 21:33:45 -0700 2009
1
2
3
#! /bin/sh
 
case $1 in
Gravatar
Wed Feb 11 16:27:37 -0800 2009
1
2
3
module SqliteVacuum
  def self.clean(model)
    inserts = generate_inserts(model)
Gravatar
Thu Jan 29 19:34:39 -0800 2009
1
2
3
# Only requires one core extension #or on the Array class.
#
# The block is evaled inside a Query class. Each property corresponds to a
Gravatar
Mon Jan 26 15:58:04 -0800 2009
1
2
3
PUBLIC_DEFER_TO_PROC = lambda do |request, params|
  locale = Config::Locale.find(params)
  # Find the page with the closest matching path. If the matching path is
Gravatar
Tue Jan 20 17:13:56 -0800 2009
1
2
3
Gluttonberg::Config.locales do
  locale :australia_english do
    location :au, "Australia"
Gravatar
Mon Jan 05 15:04:44 -0800 2009
1
2
3
Gluttonberg::PageDescription.add do
  page :home do
    home true
Gravatar
Fri Dec 12 17:35:45 -0800 2008
1
2
3
# Check types
def type_check(checks)
  checks.each do |var, types|
Gravatar
Wed Dec 10 21:16:54 -0800 2008
1
2
3
# Example usage within Gluttonberg
# Page.localized_tree("australia_english", :depth => (0..1))
 
Gravatar
Sun Nov 30 20:21:51 -0800 2008
1
2
3
Gluttonberg::PageDescriptions.describe do
  # The key is how this description will be refered to internally. The value
  # is the label, which will be used within the UI.
Gravatar
Thu Nov 27 15:55:44 -0800 2008
1
2
3
# Ajax request
@response = request(url(:help), "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest")
 
Gravatar
Wed Nov 26 21:38:05 -0800 2008
1
2
3
it "should destroy the record" do
  page_type = PageType.generate
  controller = dispatch_to(PageTypes, :destroy, :id => page_type.id)
Gravatar
Tue Nov 25 19:27:13 -0800 2008
1
2
3
name: AppName
port: 4020
environment: production
Gravatar
Mon Nov 17 15:35:43 -0800 2008
1
2
3
match("/path/to/match").defer_to do |request, params|
  if something? params[:thing]
    request.env["REQUEST_PATH"] = "/a/different/path"