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
import os, sys | |
class Setup: | |
def __init__(self, app_name): | |
self.app_name = app_name | |
self.cwd = os.path.join(os.getcwd(), app_name) | |
try: | |
print "Creating project folder..." | |
os.mkdir(app_name) | |
except OSError: |
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
info: Analyzing your application dependencies in node ./server/app.js | |
info: Checking app availability RedBull | |
info: Creating app RedBull | |
info: Creating snapshot 0.0.1 | |
info: Updating app RedBull | |
info: Activating snapshot 0.0.1 for RedBull | |
info: Starting app RedBull | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: |
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
{ | |
"name": "RedBull", | |
"description": "Testing environment for Pusher", | |
"version": "0.0.1", | |
"dependencies": { | |
"express": "2.x", | |
"express-messages": "x", | |
"redis": "0.x", | |
"socket.io": "0.x", | |
"underscore": "1.x", |
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
info: Creating snapshot 0.0.1-2 | |
info: Updating app RedBull | |
info: Activating snapshot 0.0.1-2 for RedBull | |
info: Starting app RedBull | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: There was an error while attempting to deploy your application. | |
error: | |
error: NPM Install failed | |
error: NPM failed to install dependencies |
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
info: Welcome to Nodejitsu signedon | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command env set PYTHON /opt/local/bin/python2.7 | |
info: Attempting to load env variables for app /home/garbados/code/red-bull/package.json | |
error: Error running command env set PYTHON /opt/local/bin/python2.7 | |
error: Nodejitsu Error (500): Internal Server Error | |
info: Nodejitsu not ok |
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
info: Creating snapshot 0.0.1-5 | |
info: Updating app RedBull | |
info: Activating snapshot 0.0.1-5 for RedBull | |
info: Starting app RedBull | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: There was an error while attempting to deploy your application. | |
error: | |
error: NPM Install failed | |
error: NPM failed to install dependencies |
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
""" | |
I hate CSVs, so this converts them into an array of dicts, with each key-value pair matching that column's header, and the row's value for that column. | |
""" | |
def jsonize_csv(fp): | |
with open(fp, 'r') as f: | |
headers = f.readline().split(',')[:-1] | |
lines = [] | |
for line in f: | |
line = line.split(',') |
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 DummyView = Backbone.View.extend({ | |
initialize: function(options) { | |
this.template = _.template(options.template.html()); | |
this.render(); | |
}, | |
render: function() { | |
this.$el.html(this.template({})); | |
} | |
}); |
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
import requests | |
import json | |
api_key = 'your_api_key' | |
url = "https://api.fullcontact.com/v2/person.json" | |
def whois(**kwargs): | |
if 'apiKey' not in kwargs: | |
kwargs['apiKey'] = api_key | |
r = requests.get(url, params=kwargs) |
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
import csv | |
from collections import Counter | |
class Reading(object): | |
def __init__(self, **kwargs): | |
for k,v in kwargs.iteritems(): | |
setattr(self, k, v) | |
file_list = [] # list of files | |
readings = [] |
OlderNewer