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'; | |
const decoder = | |
{ | |
4: "A", | |
7: "B", | |
5: "C", | |
9: "D", | |
6: "E", | |
8: "F", |
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
initialAmount: null, | |
hasInitialAmount: Ember.computed.gte('initialAmount', 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
ssh-add -A |
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 NoActiveRecordController < ActionController::Metal | |
include Honeybadger::Rack::UserFeedback | |
include Honeybadger::Rack::ErrorNotifier | |
include Rack::Sendfile | |
include ActionDispatch::Static | |
include Rack::Lock | |
include Rack::Runtime | |
include Rack::MethodOverride | |
include ActionDispatch::RequestId | |
include RequestStore::Middleware |
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
# Predictable SSH authentication socket location. | |
SOCK="/tmp/ssh-agent-$USER-screen" | |
if test $SSH_AUTH_SOCK && [ $SSH_AUTH_SOCK != $SOCK ] | |
then | |
rm -f $SOCK | |
ln -sf $SSH_AUTH_SOCK $SOCK | |
export SSH_AUTH_SOCK=$SOCK | |
fi |
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
def save_irb(filename) | |
File.open(filename,'w') {|f| f.puts Readline::HISTORY.entries[0..-2]} | |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
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
// see https://gist.github.com/raycohen/2296605 | |
// see https://github.com/mahonnaise/b0rked.js | |
var b0rked = 'https://raw.githubusercontent.com/mahonnaise/b0rked.js/master/b0rked.js'; | |
var script= document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = b0rked; | |
document.head.appendChild(script); | |
var logIfB0rked = function(s) { |
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
#!/usr/bin/env ruby | |
# usage: | |
# $ tail -5000 sidekiq.log | ./parse_sidekiq_logs.rb | |
class Averager | |
def initialize | |
@count = 0 | |
@total = 0.0 | |
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
require 'goliath' | |
require 'yajl' | |
# adapted from goliath/examples/async_upload.rb | |
class AsyncUpload < Goliath::API | |
use Goliath::Rack::Params # parse & merge query and body parameters | |
use Goliath::Rack::DefaultMimeType # cleanup accepted media types | |
use Goliath::Rack::Render, 'json' # auto-negotiate response format | |
def on_headers(env, headers) |
NewerOlder