Skip to content

Instantly share code, notes, and snippets.

# This extends the behavior of Rake to allow you to see all of the dependencies
# of a Rake task recursively, not just the immediate dependencies.
#
# It adds a -d option (also called --dependency-tree). Left blank, this
# option shows you dependencies for all Rake tasks. Alternatively, you
# can pass a regular expression to this option and it will only show
# dependencies for matching tasks.
#
# To use this special version of Rake, save it in a Ruby file called
# raketree.rb (but the name really doesn't matter). Here are some examples of
@techiferous
techiferous / gist:2758986
Created May 20, 2012 18:08
Example of an Ember.js handler
App.handlers.employees = Ember.Object.create({
add: function() {
App.viewables.newEmployee.reset();
App.viewables.employeeFormPane.set('adding', true);
},
cancel: function() {
App.viewables.employeeFormPane.set('adding', false);
},
@techiferous
techiferous / gist:c5409009c78ec011ce79
Created March 7, 2015 18:29
Rewrite Ruby's backtrace to cover your tracks
this_file = Regexp.new(__FILE__)
# Capture every single time an exception is raised in this Ruby program.
# Use TracePoint for Ruby 2.0+, set_trace_func for Ruby 1.9-
trace = TracePoint.new(:raise) do |tp|
exception = tp.raised_exception
backtrace = exception.backtrace
# if the source of the error is in this file
@techiferous
techiferous / 0_reuse_code.js
Created May 16, 2016 18:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console