Skip to content

Instantly share code, notes, and snippets.

View sprzybylski's full-sized avatar

Szymon Przybylski sprzybylski

View GitHub Profile
var view = new CounterView({
collection: new NotificationsCollection()
});
this.spy(view, 'render');
view.collection.add([{}]);
assert(view.render.calledOnce);
var ListCollection = Backbone.Collection.extend({
model: Bid,
comparator: function (bid) {
return -(new Date(bid.get('date'))).getTime();
},
sortASC: function (key) {
return this.sortBy(function (model) {
return model.get(key);
jshint: {
options: {
"browser": true,
"node": false,
..
"maxlen": 80,
globals: {
myBrowserGlobal: true
},
reporters: [
@sprzybylski
sprzybylski / robot.js
Created December 7, 2012 07:53
Bazinga
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@sprzybylski
sprzybylski / gist:3796731
Created September 27, 2012 22:05
PHP WAT!
<?php
$a = 0;
$b = 'x';
var_dump(FALSE == $a);
var_dump($a == $b);
var_dump($b == TRUE);
?>
info: Welcome to Nodejitsu chazm
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in app.js
/usr/local/lib/node_modules/jitsu/node_modules/require-analyzer/node_modules/npm/lib/npm.js:299
if (!conf.hasOwnProperty("prefix")) {
^
TypeError: Object #<error> has no method 'hasOwnProperty'
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy your application.
error:
error: NPM Install failed
error: NPM failed to install dependencies
error:
error: This type of error is usually a user error.
error: Error output from Haibu:
error:
//v1
switch (i) {
case '1':
execFirstMethod();
break;
case '2':
execSecondMethod();
break;
}
@sprzybylski
sprzybylski / README.md
Created May 19, 2011 14:23 — forked from bergie/README.md
Falsy Values tutorials