Skip to content

Instantly share code, notes, and snippets.

View Jon-Biz's full-sized avatar

Jonathan El-Bizri Jon-Biz

  • San Francisco
View GitHub Profile
@Jon-Biz
Jon-Biz / gist:4395bdb32831e57a781fb99189d64e8a
Created November 9, 2016 18:43
Insert an external file into Twine
(function ($) {
$(document.head)
.append('<script type="text/javascript" src="http://localhost:1234/twineAPI.js" />')
})(jQuery);
@Jon-Biz
Jon-Biz / gist:7425338
Created November 12, 2013 04:10
nodejitsu nodemailer issue package.json
{
"name": "server",
"version": "0.0.1-4",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "~3.3.4",
"jade": "~0.34.0",
@Jon-Biz
Jon-Biz / gist:5114452
Last active December 14, 2015 16:19
Jasmine-every example
var testcases = ["dataset_one"
,"dataset_two"
,"dataset_three"]
every(testcases,function(index, testcase){
describe("each Test Case",function(){
it("should be a string",function(){
expect(typeof testcase).toEqual("string");
})
})
@Jon-Biz
Jon-Biz / gist:5086093
Last active December 14, 2015 12:28
Testing Backbone js dom interactions
describe('displaying a model',function(){
var testdata = {"title":"The Title"
,"description":"Test Data"
,"content":"Test Content"}
, testmodel = new App.Data.PageModel(testdata)
, itemview;
beforeEach(function(){
$('<div id=domobject></div>').appendTo('body');
itemview = new App.Views.ItemView({el:$("#domobject")
beforeEach(function(){
// clone the Backbone Application 'App'
Data = App.module("Data");
Data.start();
var fakedata = [{"title":"Wine List"
,"description":"gallery"}];
Pages = new Data.PageCollection(fakedata);
@Jon-Biz
Jon-Biz / gist:4659516
Last active December 11, 2015 20:59
module start example
describe("A Page collection with fake data",function(){
var Data, Pages;
Data = App.module("Data");
Data.start();
beforeEach(function(){
var fakedata = [{"title":"Wine List"
@Jon-Biz
Jon-Biz / gist:4659389
Last active December 11, 2015 20:59
Backbone Marrionette Initializer Example
App.module("Midi", function(Midi){
Midi.addInitializer(function(options){
// Connect to Java interface here
}};
});
// In the Jasmine test code
@Jon-Biz
Jon-Biz / gist:4659457
Last active December 11, 2015 20:59
Module start example II
describe("A Page collection with fake data",function(){
var Data, Pages;
beforeEach(function(){
// clone the Backbone Application 'App'
var Appclone = jQuery.extend({}, App);
// access the module from the cloned app
@Jon-Biz
Jon-Biz / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var UniversalCollection = require('../universal-collection')
, _ = require('lodash')
, stateHelper = require('../../models/item/state-helpers.js')
, getStateObject = require('../../models/item/getStateObject.js')
, ItemSupplierStateCollection
, checkStateHelper = function(where, doc){
return stateHelper[where](getStateObject(doc))
}
/**