This file contains hidden or 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
| # INSTRUCTIONS | |
| # - Put this file into a directory containing mp3s | |
| # - Open in TextMate + run it (cmd+r) | |
| dir = File.dirname(__FILE__) | |
| mp3s = File.join(dir, "**", "*.mp3") | |
| Dir.glob(mp3s) do |f| |
This file contains hidden or 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.View + jquery.widget.bridge | |
| # https://gist.github.com/1641439 | |
| # | |
| # Bridge Backbone views > jQuery.ui widget | |
| # Allows instantiating BB views using jQuery | |
| # e.g. $('.slideshow').slideshow() | |
| # | |
| # requires jquery.ui.widget | |
| class window.Slideshow extends Backbone.View |
This file contains hidden or 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
| defaults write org.vim.MacVim MMTextInsetTop '10' | |
| defaults write org.vim.MacVim MMTextInsetLeft '10' | |
| defaults write org.vim.MacVim MMTextInsetBottom '10' | |
| defaults write org.vim.MacVim MMTextInsetRight '10' |
This file contains hidden or 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
| # jquery on | |
| next.on('canplay', -> | |
| console.log('canplay') | |
| # next.unbind('canplay') | |
| ) | |
| next.on('canplaythrough', -> | |
| console.log('canplaythrough') | |
| # next.unbind('canplay') |
This file contains hidden or 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.View.bridge = (klass, namespace = window) -> | |
| name = klass.charAt(0).toLowerCase() + klass.slice(1) | |
| return unless namespace[klass] | |
| console.log $.fn[name] | |
| return $.fn[name] if $.fn[name]? | |
| $.fn[name] = (options = {}) -> | |
| $el = $(this) | |
| opts = _.extend(options, { el: this }) | |
| ctor = new namespace[klass] opts | |
| data = $el.data(name) |
This file contains hidden or 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
| /* | |
| jquery.draghover.js | |
| Emulates draghover event by tracking | |
| dragenter / dragleave events of element + children. | |
| https://gist.github.com/gists/3794126 | |
| http://stackoverflow.com/a/10310815/4196 |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # Set-up Sublime settings + packages sync over Dropbox | |
| # | |
| # Will sync settings + Installed plug-ins | |
| # | |
| # Tested on OSX - should support Linux too as long as | |
| # you set-up correct SOURCE folder | |
| # | |
| # Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com |
This file contains hidden or 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
| window.installTest = -> | |
| for i in [0...500] | |
| els = $('[data-behavior~=plugin]') | |
| els.each (idx, el) -> $(el).plugin().data('plugin').uninstall() | |
| console.log i |
This file contains hidden or 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
| window.installTest = -> | |
| views = [] | |
| viewClass = app.NotificationsView | |
| options = { collection: new Backbone.Collection } | |
| views.push(new viewClass(options)) for i in [0...500] | |
| view.remove() for view in views | |
| views = [] | |
| console.log "#{viewClass.name} installed and removed x #{i}" |