Skip to content

Instantly share code, notes, and snippets.

View AndrewHenderson's full-sized avatar

Andrew Henderson AndrewHenderson

  • Newport Beach, CA
View GitHub Profile
> Witness@0.1.1-26 start /Users/andrew/witness
> app.js
sh: app.js: command not found
npm ERR! Witness@0.1.1-26 start: `app.js`
npm ERR! `sh "-c" "app.js"` failed with 127
npm ERR!
npm ERR! Failed at the Witness@0.1.1-26 start script.
npm ERR! This is most likely a problem with the Witness package,
npm ERR! not with npm itself.
error Wed, 19 Jun 2013 05:13:30 GMT
events.js:71
throw arguments[1]; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/opt/haibu/apps/ahendy/Witness/package/node_modules/socket.io/node_modules/redis/index.js:149:24)
at Socket. (/opt/haibu/apps/ahendy/Witness/package/node_modules/socket.io/node_modules/redis/index.js:83:14)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.self.errorEmitted (net.js:329:14)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
prompt: Is this ok?: (yes) y
info: Creating snapshot 0.1.1-6
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/jade
npm http GET https://registry.npmjs.org/connect-flash
npm http GET https://registry.npmjs.org/connect-redis/1.4.5
var App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({
templateName: 'application'
});
App.AllContributorsView = Ember.View.extend({
templateName: 'contributors'
});
@AndrewHenderson
AndrewHenderson / cloudantex.js
Created December 31, 2012 21:58
Cloudant Example
// Parse the json from the text area
var doc = $.parseJSON($('#newdoc').val());
// "connect" to the database
var db = $.couch.db(user_db);
// insert the doc into the db
db.saveDoc(doc, {
success: function(response, textStatus, jqXHR){
// do something if the save works
},
error: function(jqXHR, textStatus, errorThrown){
@AndrewHenderson
AndrewHenderson / saveDoc.js
Last active December 10, 2015 10:39
Non-working: Cloudant save doc using jquery.couch.js
var db = $.couch.db('https://username:password@username.cloudant.com/crud');
var doc = {"_id":"foo", "name": "bar"};
db.saveDoc(doc, {
success: function(response, textStatus, jqXHR){
console.log(response);
},
error: function(jqXHR, textStatus, errorThrown){
console.log(errorThrown);
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<style type="text/css">
.container {
margin-top: 50px;
}
</style>
@AndrewHenderson
AndrewHenderson / index.jade
Created December 17, 2012 03:52
Jade Template - Twitter Bootstrap login form.
doctype 5
html
head
meta(name='viewport', content='width=device-width, initial-scale=1')
title= title
link(rel='stylesheet', href='/css/bootstrap.css')
link(rel='stylesheet', href='/css/index.css')
body
block content
.container
@AndrewHenderson
AndrewHenderson / app.js
Created December 17, 2012 02:59
Working Passport Implementation
var express = require('express')
, routes = require('./routes')
, home = require('./routes/home')
, user = require('./routes/user')
, http = require('http')
, mongodb = require('mongodb')
, mongoose = require('mongoose')
, path = require('path')
, passport = require('passport')
, LocalStrategy = require('passport-local').Strategy
@AndrewHenderson
AndrewHenderson / index.html
Created November 5, 2012 02:18
Demo: How to Effectively Remove Backbone Views to Avoid Memory Leaks
<!DOCTYPE HTML>
<html>
<head>
<title>Backbone Memory Management</title>
<link href="style.css">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div id="app" class="container">
<h1>Zombie Destroyer 3000</h1>