Skip to content

Instantly share code, notes, and snippets.

View joshontheweb's full-sized avatar

Josh Nielsen joshontheweb

View GitHub Profile
@joshontheweb
joshontheweb / indexeddb-test.html
Last active January 18, 2017 10:32
tests adding large chunked blobs to indexeddb
<html>
<body>
<div>
Starting Quota:
<span id="startingQuota"></span>
</div>
<div>
Blob Size:
<span id="blobSize"></span>
</div>
var httpProxy = require('http-proxy');
//
// Addresses to use in the round robin proxy
//
var addresses = [
{
host: '192.241.227.80',
port: 80
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v27.0/sobjects/Product2/01t50000001D9aiAAC"
},
"Unit__r": {
"attributes": {
"type": "Unit__c",
"url": "/services/data/v27.0/sobjects/Unit__c/a2J500000008ZWTEA2"
},
@joshontheweb
joshontheweb / jspsInit.js
Created November 16, 2012 21:21
Javascript Particle System Init
// wrap canvas with Display and initialize
var display = new Display(this.canvas);
display.init();
// Initialize ParticleSystem and init with display
var particleSystem = new ParticleSystem().init(display);
// set an upper limit for total number of particles
particleSystem.maxParticles = 10000;
@joshontheweb
joshontheweb / gist:3628090
Created September 4, 2012 23:36
plateconf
// plateconf.js
var plate = require('plate')
Loader = require('plate/lib/plugins/loaders/filesystem').Loader,
path = require('path'),
plateUtils = require('./node_modules/plate/lib/utils');
// plate template rendering
var stringifyFilter = function(callback, input) {
callback(null, new plateUtils.SafeString(JSON.stringify(input)));
}
@joshontheweb
joshontheweb / filterandview.js
Created July 5, 2012 23:49
Simple Backbone Model / View
(function() {
'use strict';
// initialize namespace (arbitrary 'ns' for namespace)
window.ns = {
models: {},
views: {},
collections: {}
};
(function() {
console.log('this is a test'); if (true) { // do something loooooooooong here } else { // more long stuff }
})();