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
var util = require('util'), | |
express = require('express'), | |
httpProxy = require('http-proxy'); | |
var app = express.createServer(), | |
proxy = new httpProxy.HttpProxy(); | |
app.configure(function() { | |
app.use(express.static(__dirname + "/public")); | |
}); |
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
.clearfix { | |
display: block; | |
zoom: 1; | |
} | |
.clearfix::after { | |
clear: both; | |
content: "."; | |
display: block; | |
font-size: 0; |
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
ACTIVE_ATTRIBUTES: 35721 | |
ACTIVE_ATTRIBUTE_MAX_LENGTH: 35722 | |
ACTIVE_TEXTURE: 34016 | |
ACTIVE_UNIFORMS: 35718 | |
ACTIVE_UNIFORM_MAX_LENGTH: 35719 | |
ALIASED_LINE_WIDTH_RANGE: 33902 | |
ALIASED_POINT_SIZE_RANGE: 33901 | |
ALPHA: 6406 | |
ALPHA_BITS: 3413 | |
ALWAYS: 519 |
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} |