Skip to content

Instantly share code, notes, and snippets.

View bingomanatee's full-sized avatar

Dave Edelhart bingomanatee

View GitHub Profile
@bingomanatee
bingomanatee / bash
Created June 3, 2012 06:10
winston!
dingomanatee@li238-244:~/Glitterwood$ forever start index.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function.<anonymous> (module.js:378:11)
at Object.<anonymous> (/usr/local/lib/node/.npm/winston/0.2.5/package/lib/winston.js:9:8)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
@bingomanatee
bingomanatee / mongoose_use.js
Created June 14, 2012 22:56
Embedded Doc with _id
var friend_schema = new mongoose.Schema({
_id:mongoose.Schema.ObjectId,
name:String
});
var person_schema = new mongoose.Schema({
name:String,
friends:[friend_schema]
});
<div class="auth">
<script language="javascript">
$(function(){
var root = $('#fb-root');
if ((!root) || (!root.length)){
$('body').append('<div id="fb-root"></div>');
}
window.fbAsyncInit = function() {
console.log('fbAsyncInit');
@bingomanatee
bingomanatee / skills.html
Created July 31, 2012 20:55
Skills view in ember
<h1>Skills</h1>
<div id="skills">
</div>
<script type="text/x-handlebars" data-template-name="skill-list">
<table class="datagrid" style="width: 100%">
<thead>
<tr>
<td colspan="5" class="controls">
@bingomanatee
bingomanatee / ember_action.html
Created July 31, 2012 21:14
Ember action not working
<h1>Skills</h1>
<script type="text/x-handlebars" data-template-name="skill-list">
<table class="datagrid" style="width: 100%">
<thead>
<tr>
<td colspan="5" class="controls">
Search <input type="text" value="" class="search_field"/>
</td>
</tr>
@bingomanatee
bingomanatee / skills
Created August 3, 2012 04:01
race condition - nb-change, form properties
```javascript
angular.module('skills', ['skillsServices'])
.filter('sid', function() {
return function(id){
return id.slice(0, 5) + '...';
}
});
<h1>Wizards</h1>
<div ng-app="wizards">
<div ng-controller="WizardsCtrl" style="position: relative">
<div class="overlay" ng:show="show_new_step" style="display: none">
<figure>
<h1>Add Step for Wizard &quot;{{ new_step_wizard.title }}&quot;</h1>
@bingomanatee
bingomanatee / wizards.js
Created August 20, 2012 21:39
Wizards list controller
angular.module('wizards', ['wizardsServices']).filter('round',
function () {
return function (n) {
var v = Math.round(10 * n);
return v / 10;
}
})
angular.module('wizardsServices', ['ngResource']).
factory('Wizards', function ($resource) {
@bingomanatee
bingomanatee / bash
Created September 30, 2012 17:28
Underscore/Node problem
^
TypeError: Cannot read property 'map' of undefined
at Function._.map._.collect (/Users/dedelhart/wll/wll/node_modules/nuby-express/node_modules/underscore/underscore.js:96:25)
at Component._.extend.to_JSON (/Users/dedelhart/wll/wll/node_modules/nuby-express/lib/Component/index.js:193:32)
at _to_json (/Users/dedelhart/wll/wll/node_modules/nuby-express/lib/Component/index.js:174:22)
at Array.map (native)
at Function._.map._.collect (/Users/dedelhart/wll/wll/node_modules/nuby-express/node_modules/underscore/underscore.js:96:56)
at Framework._.extend.to_JSON (/Users/dedelhart/wll/wll/node_modules/nuby-express/lib/Component/index.js:193:32)
at File_Props._.extend.to_JSON (/Users/dedelhart/wll/wll/node_modules/nuby-express/lib/Loader/File_Props.js:24:51)
at File_Props._.extend.log (/Users/dedelhart/wll/wll/node_modules/nuby-express/lib/utility/Base.js:48:44)
@bingomanatee
bingomanatee / rest_action.js
Created October 15, 2012 21:44
Sample Action
module.exports = {
model:function () {
return this.models.slideshow;
},
/* ****** GET ****** */
on_get_validate:function (rs) {
var self = this;