This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> | |
<script type="text/javascript" src="./showdown.js"></script> | |
<title> | |
Markdown Viewer | |
</title> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Foo = Ember.Object.extend({zerb: function () {}}); | |
undefined | |
var bar = Foo.create(); | |
undefined | |
JSON.stringify(bar); | |
"{}" | |
bar.set('asdf', 'ASDF'); | |
Class {asdf: "ASDF", __ember1458770221107: null, __nextSuper: undefined, __ember_meta__: Object} | |
JSON.stringify(bar); | |
"{"asdf":"ASDF"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task('foo', {async: true}, function () { | |
var f = geddy.model.Foo.create({title: 'zerb', description: 'frang'}); | |
f.save(function (err, data) { | |
if (err) { throw err; } | |
geddy.model.Foo.all({id: f.id}, function (err, data) { | |
if (err) { throw err; } | |
console.log('Found foo', data[0].id); | |
geddy.model.Foo.first({id: f.id}, function (err, data) { | |
if (err) { throw err; } | |
console.log('Found foo again', data.id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
// $ npm install model@0.2.10 | |
model = require( 'model'), | |
Adapter = require('./node_modules/model/lib/adapters/memory/').Adapter, | |
adapter = new Adapter({}); | |
var User = function () { | |
this.adapter = adapter; | |
this.property('login', 'string', {required: true}); | |
this.property('password', 'string', {required: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Determine if `content` is a collection of models | |
else if(content instanceof Array) { | |
if(!type) { | |
throw new Error( | |
'Cannot determine model type from empty array, specify one in opts'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
var msg = ''; | |
if (testA) { | |
msg += '<div>group</div>'; | |
} | |
if (testB || testA) { | |
msg += '<div>conversation</div>'; | |
} | |
%> | |
<%= msg; %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var User = function () { | |
this.hasMany('Messages'); | |
this.hasMany('ConversationMemberships'); | |
this.hasMany('Conversations', {through: 'ConversationMembership'}); | |
}; | |
var Conversation = function () { | |
this.hasMany('Messages'); | |
this.hasMany('ConversationMemberships'); | |
this.hasMany('Users', {through: 'ConversationMembership'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
♢ cli | |
when given a config file | |
✓ should load the specified config file | |
when calling execute more than once | |
✓ should not print the results from previous execution | |
♢ eslint | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mdes-mbp-2:work mde$ geddy gen app foo | |
Created app foo. | |
mdes-mbp-2:work mde$ cd foo/ | |
mdes-mbp-2:foo mde$ geddy gen secret | |
Added app-secret to config/secrets.json. | |
DO NOT add this file into your revision control. | |
DO make a backup of it, keep it someplace safe. | |
mdes-mbp-2:foo mde$ geddy -v | |
0.9.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
templater.addListener('data', function (data) { | |
// Buffer for now, but we could stream | |
content += data; | |
}); | |
templater.addListener('end', function () { | |
if (self.params.action == 'test') { | |
if (content.indexOf('Hello') > -1) { | |
console.log(self.params.action); | |
throw new Error(); | |
} |
NewerOlder