Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
(function( $, prototype ) { | |
$.extend( prototype.options, { | |
spinner: "<em>Loading…</em>" | |
}); | |
var _create = prototype._create; | |
prototype._create = function() { | |
_create.call( this ); | |
var self = this; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>javascript unit tests...</title> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css"/> | |
</head> | |
<body> | |
<h1 id="qunit-header">QUnit Sample</h1> | |
<h2 id="qunit-banner"></h2> | |
<h2 id="qunit-userAgent"></h2> |
/* | |
A shim for non ES5 supporting browsers. | |
Adds function bind to Function prototype, so that you can do partial application. | |
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees. | |
*/ | |
Function.prototype.bind = Function.prototype.bind || function(to){ | |
// Make an array of our arguments, starting from second argument | |
var partial = Array.prototype.splice.call(arguments, 1), | |
// We'll need the original function. |
var Car = function(make, model, color) { | |
this.make = make; | |
this.model = model; | |
this.color = color; | |
}; | |
// This way works: | |
var pinto = new Car('ford', 'pinto', 'green'); | |
// but this doesn't: | |
var pinto = Car('ford', 'pinto', 'green'); |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
# in features/support/env.rb | |
require 'selenium/webdriver' | |
# we need a firefox extension to start intercepting javascript errors before the page | |
# scripts load | |
Capybara.register_driver :selenium do |app| | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
# see https://github.com/mguillem/JSErrorCollector | |
profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
Capybara::Selenium::Driver.new app, :profile => profile |
// This method gives you an easier way of calling super | |
// when you're using Backbone in plain javascript. | |
// It lets you avoid writing the constructor's name multiple | |
// times. You still have to specify the name of the method. | |
// | |
// So instead of having to write: | |
// | |
// User = Backbone.Model.extend({ | |
// save: function(attrs) { | |
// this.beforeSave(attrs); |
From Javascript Web Applications by Alex MacCaw,
"The secret to making large JavaScript applications is not to make large JavaScript applications. Instead, you should decouple your application into a series of fairly independent components. The mistake developers often make is creating applications with a lot of interdepenency, with huge linear JavaScript files generating a slew of HTML tags. These sorts of applications are difficult to maintain and extend, so they should be avoided at all costs. Paying a bit of attention to an applications structure when you start building it can make a big difference to the end result. Ignore any preconceived notions you have about JavaScript and treat it like the object-oriented language that it is. Use classes, ineritance, objects, and patterns in the same way you would if you were building an application in another language such as Python or Ruby. Architecture is critical to server-side applications, so why shouldn't the same apply to client-side apps."
Our applic