Skip to content

Instantly share code, notes, and snippets.

View samuelgoldenbaum's full-sized avatar

Samuel Goldenbaum samuelgoldenbaum

View GitHub Profile
@samuelgoldenbaum
samuelgoldenbaum / json-localstorage.js
Created June 30, 2012 13:20 — forked from robnyman/json-localstorage.js
JSON and localStorage
var cast = {
"Adm. Adama" : "Edward James Olmos",
"President Roslin" : "Mary McDonnell",
"Captain Adama" : "Jamie Bamber",
"Gaius Baltar" : "James Callis",
"Number Six" : "Tricia Helfer",
"Kara Thrace" : " Katee Sackhoff"
};
// Stores the JavaScript object as a string
(function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 1.0;
// Create/open database
var request = indexedDB.open("elephantFiles", dbVersion),
db,
createObjectStore = function (dataBase) {
@samuelgoldenbaum
samuelgoldenbaum / Object.inherit.js
Created July 3, 2012 14:20 — forked from andrewdavey/Object.inherit.js
Simple object inheritance in JavaScript
(function () {
"use strict";
var copyOwnProperties = function (from, to) {
for (var propertyName in from) {
if (from.hasOwnProperty(propertyName)) {
to[propertyName] = from[propertyName];
}
}
};
@samuelgoldenbaum
samuelgoldenbaum / kue-test.js
Last active May 2, 2017 10:31
Kue global type handler
var kue = require('kue');
describe('kue', function () { // mocha test runner
this.timeout(120000); // let it run for a while
it.only('can process the queue', function (done) {
const queue = kue.createQueue();
queue
.on('job enqueue', function (id, type) {
@samuelgoldenbaum
samuelgoldenbaum / gist:44480d5b85df95586e214bfac2ffb495
Created November 22, 2019 17:36
Updating MongoDB with Homebrew
brew services stop mongodb
brew uninstall mongodb
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community