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
require('./db'); | |
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('static-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var routes = require('./routes/index'); |
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
class @GoogleAnalytics | |
@load: -> | |
# Google Analytics depends on a global _gaq array. window is the global scope. | |
window._gaq = [] | |
window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()] | |
# Create a script element and insert it in the DOM | |
ga = document.createElement("script") | |
ga.type = "text/javascript" |
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
tbr_models = Model.column_names - ['id', 'name', ... , 'created_at', 'updated_at'] | |
tbr_models.each do |model_column| | |
remove_column :models, model_column | |
puts "-- #{model_column}" | |
end |
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
[ | |
{ | |
"date"=>"Monday, June 01, 2015", | |
"slot"=>"15:00", | |
"agents_count"=>[ | |
"agent13" | |
] | |
}, | |
{ | |
"date"=>"Monday, June 01, 2015", |
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
# postgres upgrading from 9.3 to 9.4 | |
brew switch postgres 9.3 # presuming you already installed 9.4.4 | |
pg_dumpall > outputfile | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
mv /usr/local/var/postgres /usr/local/var/postgres.old | |
brew switch postgres 9.4.4 | |
initdb -D /usr/local/var/postgres | |
psql -d postgres -f outputfile |
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
##################################### | |
# 0. SET UP AWS (ASSUMING YOU HAVE ALREADY SET UP AN ACCOUNT) | |
# CREATE SECURITY GROUP | |
• In the EC2 Dashboard, click Security Groups, then Create Security Group. | |
• Enter Name | |
• Enter Description | |
• Rules to add: | |
- HTTP | |
- SSH |
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
⚡ gcloud info | |
Google Cloud SDK [126.0.0] | |
Platform: [Mac OS X, x86_64] | |
Python Version: [2.7.10 (default, Jun 10 2015, 19:42:47) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]] | |
Python Location: [/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python] | |
Site Packages: [Disabled] | |
Installation Root: [/Users/dhirajbajaj/google-cloud-sdk] | |
Installed Components: |
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
{ | |
"responseCode": 200, | |
"responseMessage": "Players fetched successfully.", | |
"match_data": { | |
"id": 222, | |
"home_team_id": 3, | |
"away_team_id": 1, | |
"created_at": "2017-01-05T18:51:19.077+05:30", | |
"updated_at": "2017-01-05T18:51:19.077+05:30", | |
"start_time": "2017-01-19T09:30:00.000+05:30", |
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
=== Query | |
curl -i -X GET \ | |
"https://graph.facebook.com/v2.10/me?fields=id%2Cname%2Cbirthday%2Cemail%2Ceducation%2Cgender%2Cpicture%2Cfirst_name%2Clast_name%2Chometown%2Clocation%2Cverified%2Cwork%2Crelationship_status%2Creligion%2Cpolitical%2Clink%2Ccontext%2Cphotos&access_token=<access token sanitized>" | |
=== Access Token Info | |
{ | |
"perms": [ | |
"user_birthday", | |
"user_religion_politics", | |
"user_relationships", | |
"user_relationship_details", |