View redis_controller.rb
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 RedisController < ApplicationController | |
private | |
def render_from_redis(prefix, variation = nil) | |
manifest_id = params[:manifest_id] | |
if manifest_id.blank? | |
current_manifest_key = if variation | |
"#{prefix}:#{variation}:current" | |
else | |
"#{prefix}:current" |
View Brocfile.js
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
function AssetImporterPlugin(options, appName) { | |
this.name = 'yapp-asset-importer'; | |
this.appName = appName; | |
this.options = options || {}; | |
} | |
AssetImporterPlugin.prototype.treeFor = function treeFor(name) { | |
if (name !== "styles") { return; } | |
return pickFiles('shared-assets', { | |
srcDir: '/images', |
View index.js
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
Pd3.IndexRoute = Ember.Route.extend({ | |
activate: function(){ | |
var route = this; | |
this.recurringFetchId = window.setInterval(function() { | |
Ember.$.getJSON('/s/1.json').then(function(json){ | |
Ember.run(function(){ | |
route.controller.set('model', json); | |
}); | |
}); | |
}, 5*1000); |
View image-load.js
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
import Ember from 'ember'; | |
var on = Ember.on; | |
var set = Ember.set; | |
var run = Ember.run; | |
var Mixin = Ember.Mixin; | |
var computed = Ember.computed; | |
var getWithDefault = Ember.getWithDefault; | |
export default Mixin.create({ |
View gist:42973
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
#features/steps/users_steps.rb: | |
Given "I'm a logged in member" do | |
@me = create_adult | |
logged_in_as @me | |
end | |
#features/support/env.rb: | |
class Cucumber::Rails::World |
View gist:83377
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
require "benchmark" | |
x = 10_000 | |
first_id = Sport.first.id | |
key = "Sport:#{first_id}" | |
Sport.set key, Sport.find(first_id) # prime cache | |
Benchmark.bm(20) do |b| | |
b.report "Sport.get" do |
View gist:83390
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
74.201.152.100:8298 -> | |
==> /data/weplay/shared/log/mongrel.5002.log <== | |
** [Exceptional] Error contacting Exceptional: execution expired | |
** [Exceptional] /usr/lib64/ruby/1.8/timeout.rb:54:in `rbuf_fill' | |
/usr/lib64/ruby/1.8/timeout.rb:56:in `timeout' | |
/usr/lib64/ruby/1.8/timeout.rb:76:in `timeout' | |
/usr/lib64/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' | |
/usr/lib64/ruby/1.8/net/protocol.rb:116:in `readuntil' | |
/usr/lib64/ruby/1.8/net/protocol.rb:126:in `readline' | |
/usr/lib64/ruby/1.8/net/http.rb:2029:in `read_status_line' |
View gist:83579
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
m_local = MemCache.new('127.0.0.1:11211') | |
=> <MemCache: 1 servers, ns: nil, ro: false> | |
>> m_remote = MemCache.new('ey04-s00298:11211') | |
=> <MemCache: 1 servers, ns: nil, ro: false> | |
>> | |
?> first_id = Sport.first.id | |
=> 1 | |
>> key = "Sport:#{first_id}" | |
=> "Sport:1" | |
>> m_local.set key, Sport.find(first_id) # prime cache |
View gist:146708
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
[22:38-focus!][weplay(master)]$ rake db:migrate --trace | |
(in /Users/lmelia/devprojects/weplay) | |
** Invoke db:migrate (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:migrate | |
== AddJerseyNumberToMembership: migrating ==================================== | |
-- add_column(:memberships, :jersey_number, :string, {:limit=>20}) | |
-> 658.3954s | |
== AddJerseyNumberToMembership: migrated (658.3955s) ========================= |
View gist:157861
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
(::) failed steps (::) | |
expected 237 +/- (< 20), got 0 (Spec::Expectations::ExpectationNotMetError) | |
/Users/lmelia/devprojects/weplay/vendor/plugins/rspec/lib/spec/expectations/fail_with.rb:39:in `fail_with' | |
/Users/lmelia/devprojects/weplay/vendor/plugins/rspec/lib/spec/expectations/handler.rb:21:in `handle_matcher' | |
/Users/lmelia/devprojects/weplay/vendor/plugins/rspec/lib/spec/expectations/extensions/kernel.rb:27:in `should' | |
./features/steps/selenium/color_picker_steps.rb:101:in `/^the live preview should have new primary and secondary colors$/' | |
features/selenium/change_colors.feature:57:in `Then the live preview should have new primary and secondary colors' | |
expected element matching "#membership_136960 .children" to contain the text "(?-mix:Joe\ Player)", but was "" (Spec::Expectations::ExpectationNotMetError) |
OlderNewer