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
#### | |
# ZSH function to auto-switch to correct Node version | |
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5 | |
# | |
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does. | |
# | |
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING. | |
# | |
# - Works correctly if your .nvmrc file contains something relaxed/generic, | |
# like "4" or "v12.0" or "stable". |
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
// backbone's `defaults` can be a function. | |
// | |
// if you need the default value to be evaluated | |
// every time you instantiate a new model, then | |
// it should be a function, not an object literal. | |
// | |
// object literals are only evaluated once, when the | |
// object is defined. | |
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
// v0.9.0 of Marionettte will strip down the Modules to bare minimums, removing | |
// the ability to add initializers. you can re-add them to your module, as-needed, | |
// by doing this: | |
MyApp.module("Foo", function(Foo, MyApp, Backbone, Marionette){ | |
var initCallbacks = new Marionette.Callbacks(); | |
Foo.addInitializer = function(initializer){ | |
initCallbacks.add(initializer); | |
} |
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 | |
dry_run = ARGV.delete('--dry-run') | |
force = ARGV.delete('--force') | |
if ARGV.empty? | |
puts <<-USAGE | |
minify, swiftly concat and minify JavaScript files from the command line | |
Pass a single argument to create a .min.js version: |