Skip to content

Instantly share code, notes, and snippets.

View kmiyashiro's full-sized avatar
🐻

Kelly Miyashiro kmiyashiro

🐻
  • San Francisco, CA
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
npm ERR! Error: No compatible version found: connect@'>=2.4.4- <2.5.0-'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.1.0","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.3.0","0.4.0","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.5.5","0.5.6","0.5.7","0.5.8","0.5.9","0.5.10","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.2.0","1.2.1","1.2.2","1.2.3","1.3.0","1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5","1.4.6","1.5.0","1.5.1","1.5.2","1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.7.0","1.7.1","1.7.2","1.7.3","1.8.0","1.8.1","1.8.2","1.8.3","1.8.4","1.8.5","2.0.0","2.0.1","2.0.2","2.0.3","1.8.6","2.1.0","2.1.1","2.1.2","1.8.7","2.1.3","2.2.0","2.2.1","2.2.2","2.3.0","2.3.1","2.3.2","2.3.3","1.9.0","1.9.1","2.3.4","2.3.5","2.3.6","2.3.7","1.9.2","2.3.8","2.3.9","2.4.0","2.4.1","2.4.2","2.4.3"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:553:10)
npm ERR!
/**
* Module dependencies.
*/
var express = require('express'),
fs = require('fs');
var app = module.exports = express.createServer();
var port = (app.settings.env == 'test') ? 8000 : 3001;
// Calls done when db is finished connecting
exports.dbReady = function(done) {
var db = require('../../models/db');
switch (db.state) {
case 'connected':
done();
break;
case 'connecting':
db.once('open', done);
@kmiyashiro
kmiyashiro / CleanView.js
Created April 7, 2012 22:32
Backbone wrapper
/**
* Extend Backbone.View to have a "close" function.
* Unbind all triggers and events.
* Save an array of all bound events to unbind
* Define onClose on views to clean up model/collection listeners
*/
define(function(require) {
var Backbone = require('use!libs/backbone/backbone'),
_ = require('use!underscore');
@kmiyashiro
kmiyashiro / grunt.js
Created March 12, 2012 21:16
mote grunt task
/*global config:true, task:true*/
config.init({
options: {
templates: {
namespace: "tmpl",
dir: 'templates'
}
},
pkg: '<json:package.json>',
test: {
@kmiyashiro
kmiyashiro / gist:2013589
Created March 10, 2012 22:17
Upsert nested array/objects possible?
I have a schema that looks like this:
band: {
albums: [
{ tweets: [
{ tweet }, { tweet }
] }
]
}
I want to add the band (doc) if it doesn't exist.
@kmiyashiro
kmiyashiro / MyView.js
Created February 6, 2012 18:06
Auto re-use element?
checkExisting: function() {
var existing = $(this.id)[0];
if (existing) this.setElement(existing);
}}
@kmiyashiro
kmiyashiro / locations
Created January 16, 2012 07:05
test file
js
model
user.js
test
test.js
Error: Calling node's require("model/user") failed with error: Error: Cannot find module 'model/user'
({
appDir: "../js",
baseUrl: "./",
dir: "../js-deploy",
//Comment out the optimize line if you want
//the code minified by UglifyJS
optimize: "none",
paths: {
'app' : 'app',