Skip to content

Instantly share code, notes, and snippets.

View mde's full-sized avatar

Matthew Eernisse mde

View GitHub Profile
@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
function filterGhNotifications() {
var sourceLabel = GmailApp.getUserLabelByName('GH');
var addedLabel = GmailApp.getUserLabelByName('GH -- mde');
var pat = /@mde/;
var threads;
var foundThreads = [];
threads = sourceLabel.getThreads(0, 20);
threads.forEach(function (thread) {
var messages = thread.getMessages();
var subject;
@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
---- (somewhere in the page head) ----
<script type="text/javascript">
yam.connect.loginButton('#yammer-login', function (resp) {
if (resp.authResponse) {
document.getElementById('yammer-login').innerHTML = 'Welcome to Yammer!';
}
});
var Item = function () {
this.defineProperties({
name: {type: 'string'}
});
this.findByName = function (name, callback) {
geddy.model.Item.all({name: name}, callback);
}
}