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
var a,b,c,d; | |
(function(a,b,c,d){}).length // => 4 | |
a = function(b,c,d){}; | |
a.length // => 3 |
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
// shift+up and shift+down to move between channels | |
// | |
// copy and paste into the console | |
// or if you're using Fluid.app put | |
// in Userscripts | |
$(document).bind('keydown', function(e){ | |
var shifted = e.shiftKey; | |
if (e.keyCode == 40 && shifted) { |
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
!function($) { | |
App.on('messageAdded', function() { | |
var $pic, $picLI, index, $prevLI, $prevPic, | |
$picSeparator, $picContent, | |
$pics = $('.userpic img'), | |
SPACING = '3px'; | |
for(index = $pics.length - 1; index >= 0; index--) { | |
$pic = $($pics[index]); | |
$picLI = $pic.closest('li'); |
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
if (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.ImageReplacer = Class.create({ | |
_defaultOptions: { | |
listenToSwapView: true, | |
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
filenameInsert: "_☃x", | |
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
attribute: "data-hires", |
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
class Component extends Backbone.View | |
defaults: | |
'visible': true | |
initialize: -> | |
# defaults gets overriden by @config, which is overridden | |
# by the passed in options on initialization. So @config | |
# acts as @defaults for something that extends Component | |
@options = _.extend({}, @defaults, @config, @options) |
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
class Component extends Backbone.View | |
defaults: | |
'visible': true | |
initialize: -> | |
# defaults gets overriden by @config, which is overridden | |
# by the passed in options on initialization. So @config | |
# acts as @defaults for something that extends Component | |
@options = _.extend({}, @defaults, @config, @options) |
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
class Component extends Backbone.View | |
defaults: | |
'visible': true | |
initialize: -> | |
# defaults gets overriden by @config, which is overridden | |
# by the passed in options on initialization. So @config | |
# acts as @defaults for something that extends Component | |
@options = _.extend({}, @defaults, @config, @options) |
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
class Component extends Backbone.View | |
initialize: -> | |
for func, args of @options | |
if @[func]? | |
if _.isArray(args) | |
@[func].apply?(@, args) | |
else | |
@[func].call?(@, args) | |
return null |
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
class Component extends Backbone.View | |
initialize: -> | |
for func, args of @options | |
unless _.isArray(args) | |
@[func]?.call(@, args) | |
else | |
@[func]?.apply(@, args) | |
return null |
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.Component extends Backbone.View | |
initialize: -> | |
for func, args of @options | |
unless _.isArray(args) | |
@[func]?.call(@, args) | |
else | |
@[func]?.apply(@, args) | |
render: => |