This file contains 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
root :to => "users#dashboard", :constraints => lambda { |r| r.env["warden"].authenticate? } | |
root :to => "home#index" |
This file contains 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 aspect = {}; | |
aspect.add = function (obj, fnName, aspectFn, when, once) { | |
if ('object' !== typeof obj) throw new TypeError('Must pass an object as the first argument'); | |
obj = obj || window; | |
if (Array.isArray(fnName)) { | |
fnName.forEach(function (name) { | |
aspect._add(obj, name, aspectFn, when, once); |
This file contains 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
// TODO: | |
// - TemplateView | |
// - change the way templates are compiled (store compiled version inside view "class"?) | |
// | |
// - CollectionView | |
// - cleanup layout rendering if it depends on collection (remove collection container from DOM, rerender the layout and attach it again?) | |
// - store model views together with models (?) | |
// | |
// - ModelView | |
// - extend Model#toJSON to convert nested objects as well (http://rcos.rpi.edu/projects/concert/commit/got-requests-displaying-properly-again/) |
This file contains 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
# lib/mail/queued_delivery.rb | |
require 'mail' | |
module Delayed | |
class PerformableMail | |
attr_reader :mail | |
def initialize(mail) | |
@mail = mail | |
end |
This file contains 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
;; emacs configuration | |
(push "/usr/local/bin" exec-path) | |
(add-to-list 'load-path "~/.emacs.d") | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
(setq inhibit-startup-message t) |
This file contains 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 net = require('net'), | |
util = require('util'), | |
zombie = require('zombie'), | |
browser = new zombie.Browser, | |
buffer = ""; | |
net.createServer(function (socket) { | |
socket.setEncoding('utf8'); | |
socket.on('data', function (data) { |
This file contains 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
# Using Ruby with "rack" gem - run using "rackup" | |
use Rack::Static, :urls => [""]; run nil |
This file contains 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 ActiveRecord::Base | |
# Allow to bypass Delayed Job asynchronous handling | |
def self.dont_handle_asynchronously(*methods) | |
method_aliases = {} | |
methods.each do |method| | |
# TODO move this part into Delayed::MessageSending::ClassMethods#handle_asynchronously | |
aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1 | |
with_method, without_method = "#{aliased_method}_with_delay#{punctuation}", "#{aliased_method}_without_delay#{punctuation}" | |
method_aliases[method] = {:with => with_method, :without => without_method} |
This file contains 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
From d75eb570e16f765b5c6acee8f1fc1c8013eeba4f Mon Sep 17 00:00:00 2001 | |
From: Szymon Nowak <szimek@gmail.com> | |
Date: Mon, 11 Oct 2010 19:37:03 +0200 | |
Subject: [PATCH] Return a valid empty JSON on successful PUT and DELETE requests. | |
--- | |
.../lib/action_controller/metal/responder.rb | 20 ++++++++++++++++++++ | |
actionpack/test/controller/mime_responds_test.rb | 19 +++++++++++++++++++ | |
2 files changed, 39 insertions(+), 0 deletions(-) |
This file contains 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
#!/bin/bash | |
if [ -f .rvmrc ]; then | |
source .rvmrc | |
fi |