I hereby claim:
- I am onyxrev on github.
- I am danconnor (https://keybase.io/danconnor) on keybase.
- I have a public key whose fingerprint is 3E5D 33CF 44C7 CCCC 6FDA 1844 2F4A 04F5 9A92 FFC5
To claim this, I am signing this object:
| //= require ../../app/assets/javascripts/lib/polyfills | |
| //= require_tree ./templates | |
| //= require_tree ./frontend/templates | |
| //= require_tree ./backend/templates | |
| window.env = 'test'; |
I hereby claim:
To claim this, I am signing this object:
| require 'yaml' | |
| task :deploy do | |
| servers_config = YAML::load( File.open( './config/servers.yml' ) ) | |
| task :staging do | |
| servers = servers_config["staging"].values.flatten | |
| # forward the docker port for each server to localhost | |
| port_forwards = [] |
| // this imageSizeDetector works in lieu of img.onload | |
| (function(jQuery){ | |
| jQuery.fn.imageSizeDetector = function(callback){ | |
| var $image = this; | |
| var width = 0; | |
| var height = 0; | |
| var pollCount = 0; | |
| var callback = callback; | |
| var interval = setInterval(function(){ |
| class ApplicationController < ActionController::Base | |
| # ... | |
| private | |
| # from https://gist.github.com/josevalim/fb706b1e933ef01e4fb6 | |
| def authenticate_user_from_token! | |
| email = params[:email].presence | |
| user = email && User.where(email: email).first |
| # usage: | |
| # select2_choose("#some_element_id_with_select2_attached", :query => "Santa", :choose => "Santa Monica, California") | |
| # NOTE: just make sure your 'choose' is unique in your results set | |
| module Select2Helper | |
| def select2_choose(id, options) | |
| page.execute_script %Q{ | |
| i = $('#s2id_#{id} .select2-offscreen'); | |
| i.trigger('keydown').val('#{options[:query]}').trigger('keyup'); | |
| } | |
| (function(){ | |
| jQuery.ajaxSetup({ | |
| /* this ugly shit is to ensure that Rails gets its happy little CSRF tokens */ | |
| 'beforeSend': function(xhr) { | |
| var token = $("meta[name='csrf-token']").attr("content"); | |
| xhr.setRequestHeader("X-CSRF-Token", token); | |
| // since the anchor bit of the URL isn't sent by the | |
| // browser, it's not available for the rails app in | |
| // request.referrer. since we use the anchor bit of the |