This file contains hidden or 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
... | |
# Define the schema for the user | |
schema = new db.Schema | |
name : | |
first_name : String | |
last_name : String | |
location : String | |
created_at : | |
type : Date | |
default : Date.now |
This file contains hidden or 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 :restart, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && sudo kill -SIGUSR2 `cat tmp/pids/master.pid`" | |
end |
This file contains hidden or 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
plugin.onMessageInsertion = function(event){ | |
if(event.content.match(/!\w{2}\d{4,}/)) { | |
var last_message = Talker.getLastRow(); | |
var contents = last_message.html(); | |
var newContents = contents.replace(/!(\w{2}\d{4,})/g,'<a style="font-weight: bold;border-bottom: 1px solid #F15c50" href="http://epic.io/$1">!$1</a>'); | |
last_message.html(newContents); | |
} | |
} |
This file contains hidden or 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 News = db.model('News'); | |
app.get('/dashboard', function (req, res, next) { | |
req.user.getLikes(function(err, likes){ | |
if (err) return next(err); | |
News.getLatest(function(err, news){ | |
if (err) return next(err); | |
res.render('dashboard', { likes: likes, latestNews: news }); | |
}); | |
}); | |
}); |
This file contains hidden or 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
server.get '/', app.helpers.loadUser, helpers.loadAccounts, helpers.loadExpenses, helpers.loadCategories, controllers.expenses.index | |
... | |
controllers.expenses = | |
index : (req, res) -> | |
res.render 'index' | |
categories : req.categories | |
expenses : req.expenses | |
user : req.user | |
accounts : req.accounts |
This file contains hidden or 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
server.get '/', controllers.expenses.index | |
... | |
controllers.expenses = | |
index : (req, res) -> | |
res.render 'index' | |
user : req.user | |
categories : req.user.getCategories() | |
expenses : req.user.getExpenses() | |
accounts : req.user.getAccounts() |
This file contains hidden or 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
The JSON google sends you with ?alt=json | |
folderJSON['gd$resourceId']['$t'] | |
Taking the default XML from google through xml2js | |
folderJSON['gd:resourceId'] | |
This file contains hidden or 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
vows = require 'vows' | |
assert = require 'assert' | |
cb = (callback) -> | |
setTimeout -> | |
callback(null, 'callback') | |
, 2000 | |
andWaitForCallback = undefined |
This file contains hidden or 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
Error: Socket is not writable | |
at Socket._writeOut (net.js:391:11) | |
at Socket.write (net.js:377:17) | |
at Master.<anonymous> (/root/epic.io/node_modules/cluster/lib/master.js:226:13) | |
at Master.call (/root/epic.io/node_modules/cluster/lib/worker.js:73:17) | |
at HTTPServer.<anonymous> (/root/epic.io/node_modules/cluster/lib/plugins/stats.js:62:18) | |
at HTTPServer.emit (events.js:81:20) | |
at IOWatcher.callback (net.js:948:12) | |
Error: Socket is not writable | |
at Socket._writeOut (net.js:391:11) |
This file contains hidden or 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
git pull | |
remote: Counting objects: 37, done. | |
remote: Compressing objects: 100% (10/10), done. | |
remote: Total 22 (delta 12), reused 21 (delta 11) | |
Unpacking objects: 100% (22/22), done. | |
/data/github/current/lib/github/config/failbot.rb:5: undefined method `setup' for Failbot:Module (NoMethodError) | |
from /data/github/current/config/basic.rb:168:in `require' | |
from /data/github/current/config/basic.rb:168 | |
from hooks/post-upload-pack:5:in `require' | |
from hooks/post-upload-pack:5 |