Skip to content

Instantly share code, notes, and snippets.

View mde's full-sized avatar

Matthew Eernisse mde

View GitHub Profile
@mde
mde / gist:6100608
Created July 28, 2013 22:52
Istanbul output
♢ 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
@mde
mde / gist:6040868
Created July 19, 2013 17:23
geddy gen secret
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
@mde
mde / gist:5476069
Created April 28, 2013 06:14
Templater race
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();
}
@mde
mde / gist:5471951
Created April 27, 2013 05:07
Main controller with all JSON format
var Main = function () {
this.index = function (req, resp, params) {
this.respond(params, {
format: 'json'
});
};
this.test1 = function (req, resp, params) {
this.respond(params, {
format: 'json'
upstream zerb_blarg {
server 127.0.0.1:4000;
}
server {
listen 80;
server_name www.zerb-blarg.org zerb-blarg.org;
access_log /var/log/nginx/zerb_blarg.access.log;
location / {
proxy_pass http://zerb_blarg;
}
@mde
mde / gist:5368115
Last active December 16, 2015 03:09
var Zoobies = function () {
this.respondsWith = ['json', 'js', 'xml];
this.create = function (req, resp, params) {
var self = this
, zooby = geddy.model.Zooby.create(params);
if (!zooby.isValid()) {
params.errors = zooby.errors;
// Figure out how you want to respond with an error
@mde
mde / gist:4238518
Created December 8, 2012 03:56
Setting var in beforeFilter for use in view
// Application controller
var Application = function () {
this.before(function () {
geddy.log.info('setting foo');
this.foo = 'BAR';
});
};
@mde
mde / gist:4047384
Created November 9, 2012 18:32
`geddy scaffold` breakage
mdes-mbp-2:bar mde$ ../geddy/bin/cli.js scaffold zooby
[Added] app/models/zooby.js
Creating table for Zooby
[Added] test/zooby.js
[Added] app/controllers/zoobies.js
[Added] Resource zoobies route added to config/router.js
jake aborted.
TypeError: ejs:10
8| <div class="row list-item">
(See full trace by running task with --trace)
git clone git@github.com:mde/geddy.git
cd geddy
npm install
cd ..
./geddy/bin/cli.js app foo
cd foo
../geddy/bin/cli.js auth
../geddy/bin/cli.js
git clone git@github.com:mde/geddy.git
cd geddy
checkout -t origin/passport-integration
mkdir node_modules
npm install
cd ..
git clone git@github.com:mde/geddy-passport.git
cd geddy-passport
npm install
../geddy/bin/cli.js