Command Line
pry -r ./config/app_init_file.rb- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb- load your rails into a pry session
Debugger
| // Simple interface used to execute a callback in different ways depending on | |
| // whether or not a function returns a promise or not. | |
| // Usage: | |
| // import Promisable from 'promisable'; | |
| // | |
| // Promisable(someFunction()).then(() => { | |
| // promiseWasSuccessful() | |
| // }, promiseFailed()); | |
| // |
| /* | |
| * common react, redux staff here | |
| */ | |
| import {Router, createRoutes} from 'react-router'; | |
| import createBrowserHistory from 'history/lib/createBrowserHistory'; | |
| import rawRoutes from './routes'; | |
| import store from './store'; | |
| function mixStoreToRoutes(routes) { | |
| return routes && routes.map(route => ({ |
| stats = Sidekiq::Stats.new | |
| stats.queues | |
| stats.enqueued | |
| stats.processed | |
| stats.failed |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| //Returns the object's class, Array, Date, RegExp, Object are of interest to us | |
| var getClass = function(val) { | |
| return Object.prototype.toString.call(val) | |
| .match(/^\[object\s(.*)\]$/)[1]; | |
| }; | |
| //Defines the type of the value, extended typeof | |
| var whatis = function(val) { | |
| if (val === undefined) |
| # If your workers are inactive for a long period of time, they'll lose | |
| # their MySQL connection. | |
| # | |
| # This hack ensures we re-connect whenever a connection is | |
| # lost. Because, really. why not? | |
| # | |
| # Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
| # | |
| # From: | |
| # http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |