View gist:4dff6114d9e3f2ef1540
syntastic: 763.666280: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shellslash = 0, &shelltemp = 1, &shellxquote = '', &shellxescape = ''
syntastic: 763.666593: g:syntastic_aggregate_errors = 0
syntastic: 763.666593: g:syntastic_always_populate_loc_list = 0
syntastic: 763.666593: g:syntastic_auto_jump = 0
syntastic: 763.666593: g:syntastic_auto_loc_list = 2
syntastic: 763.666593: g:syntastic_bash_hack = 0
syntastic: 763.666593: g:syntastic_check_on_open = 1
syntastic: 763.666593: g:syntastic_check_on_wq = 1
syntastic: 763.666593: g:syntastic_cursor_columns = 1, b:syntastic_cursor_columns = 1
syntastic: 763.666593: g:syntastic_debug = 63
View 0001-Added-deregisterContext-method-to-Engine.patch
From 63aae6759669ccafcf235dd0fdc17f2990cc5699 Mon Sep 17 00:00:00 2001
From: Andrew de Andrade <andrew@deandrade.com.br>
Date: Fri, 27 Jun 2014 13:16:01 -0700
Subject: [PATCH] Added deregisterContext method to Engine
---
Engine.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Engine.js b/Engine.js
View gist:3063591
$ ./bin/casperjs test tests/suites
Test file: /Users/andrew/github/casperjs/tests/suites/casper/agent.js
PASS Default user agent matches /CasperJS/
PASS Default user agent matches /plop/
Test file: /Users/andrew/github/casperjs/tests/suites/casper/capture.js
# Casper.capture()
PASS Casper.capture() captured a screenshot
# Casper.captureBase64()
PASS Casper.captureBase64() rendered a page capture as base64
FAIL CasperError: No element matching selector found: ul
View app.js
var spawn = require('child_process').spawn
var instance = {
ipAddress: "0.0.0.0"
};
var awsPreSharedKeyPath = '~/.ssh/aws-preshared-key.pem'; // make sure key has permissions 600 with chmod
var spawnArgs = [ '-tt', // force teletype since ssh uses a psuedo-terminal
View backbone.history
Backbone.History.prototype.urlHistory = {
stack: [],
currentIndex: 0,
current: function() {
return this.stack[this.currentIndex];
},
previous: function() {
View backbone view that calls the wizard ui element
namespace.views.MyWizard = Backbone.Views.extend({
initialize: function() {
_.bindAll(this, 'render', 'wizardMethod');
}
render: function() {
this.wizardMethod();
return this;
},
View reverse_alphabetical_sort_in_backbone
// Assumption: You have a model with a name.
comparator: function (User) {
if (User.get("name")) {
var str = User.get("name");
str = str.toLowerCase();
str = str.split("");
str = _.map(str, function(letter) { return String.fromCharCode(-(letter.charCodeAt(0))) });
return str;
};
View Nested Model Example in Backbone.js
// The following is your top-level parent model in serialized JSON format:
var myModel = new Person({
"name" : {
"first_name" : "Andrew",
"last_name" : "de Andrade"
},
"address" : {
"street_address_1" : "Avenida Paulista 1000",
"street_address_2" : "Apt. 101",
View gist:912580
// My controller:
pg.controllers.Main = Backbone.Controller.extend({
routes: { },
initialize: function () {
pg.account = new pg.model.Account(window.account);
Users = new pg.collections.UserList({ url: "/profiles" });
Backbone.history.start();
View gist:844569
Project = Backbone.Model.extend({
initialize: function() {
_.bindAll(this, 'getRules', 'saveRules');
this.getRules();
this.rules.bind('add', this.saveRules);
this.rules.bind('remove', this.saveRules);
},
getRules: function() {