Skip to content

Instantly share code, notes, and snippets.

eeeb144c (coquin 2011-12-29 15:38:49 +0400 1) <li class="WithIcon">
ff277b91 (Glenn Goodrich 2012-01-18 20:28:05 -0500 2) <!-- ko with: owner -->
eeeb144c (coquin 2011-12-29 15:38:49 +0400 3) <img data-bind="attr: { src: avatarURL, alt: fullName }" /> <span class="Truncate" data-bind="text: fullName"></span>
ff277b91 (Glenn Goodrich 2012-01-18 20:28:05 -0500 4) <!-- /ko-->
ff277b91 (Glenn Goodrich 2012-01-18 20:28:05 -0500 5) <a href="#" data-bind="click: $parent.toggleSelected, css: { SharePanelTagsRemove: selected }" class="SharePanelTagsAdd">+</a>
ff277b91 (Glenn Goodrich 2012-01-18 20:28:05 -0500 6) </li>
@elight
elight / gist:1831424
Created February 14, 2012 23:04
Clearly I'm going insane
[23] pry(ActionView::Helpers::InstanceTag)> object.system
=> false
[24] pry(ActionView::Helpers::InstanceTag)> method_name
=> "system"
[25] pry(ActionView::Helpers::InstanceTag)> object.send(method_name)
ArgumentError: wrong number of arguments
from (pry):16:in `system'
[27] pry(ActionView::Helpers::InstanceTag)> object.method(method_name).arity
=> 0
Tracing route to swtor.com [159.153.92.41]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms Infinity [192.168.0.1]
2 8 ms 6 ms 14 ms 10.21.162.1
3 47 ms 47 ms 47 ms 172.30.31.1
4 47 ms 47 ms 47 ms 172.30.31.70
5 47 ms 47 ms 47 ms 172.30.31.77
6 220 ms 231 ms 281 ms 12.116.20.41
7 244 ms 284 ms 256 ms cr84.attga.ip.att.net [12.122.140.58]
@elight
elight / config.ru
Created March 8, 2012 03:35
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
// Pulled from http://emberjs.com/
MyApp.president = Ember.Object.create({
firstName: "Barack",
lastName: "Obama",
fullName: function() {
// Calls to get() can track the dependency (ala https://github.com/SteveSanderson/knockout/blob/master/src/subscribables/dependentObservable.js#L122)
return this.get('firstName') + ' ' + this.get('lastName');
@elight
elight / hack.sh
Created March 31, 2012 12:03 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
# I'm sorry but whoever wrote this is a sick motherfucker or the developer was severely drunk and/or stoned at the time.
def yield_objects(offset, &block)
yield *[soap, wsdl, http, wsse][offset, block.arity]
end
@elight
elight / fail.rb
Created July 23, 2012 21:08
Interesting AR failure
class Base < ActiveRecord::Base
end
class Ticket < Base
end
@elight
elight / gist:3166609
Created July 23, 2012 22:21
inheritance.rb
module ClassMethods
# True if this isn't a concrete subclass needing a STI type condition.
def descends_from_active_record?
if superclass.abstract_class?
superclass.descends_from_active_record?
else
superclass == Base || !columns_hash.include?(inheritance_column)
end
end
@elight
elight / worker.rb
Created August 6, 2012 22:16
Partially elided patch to Resque to mitigate monkey patching need to support extra hooks
module Resque
def self.hook_responders
@hook_responders ||= [self]
@hook_responders
end
def self.register_hook_responder(responder)
hook_responsers << responder
end