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
from flask import Flask, jsonify, make_response, redirect, request | |
import urllib | |
import requests | |
app = Flask(__name__) | |
# Config | |
callback = 'http://localhost:5000/auth/mlh/callback' | |
client_id = '[ INSERT CLIENT ID ]' | |
client_secret = '[ INSERT CLIENT SECRET ]' |
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
<style> | |
.row { margin: 30px 0 60px; } | |
</style> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-3"> | |
<h3>Headers & Body</h3> | |
</div> |
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
abridgments | |
abrogations | |
abrupter | |
abscessing | |
abscissae | |
abstractnesses | |
accessioning | |
acclimatizes | |
accusatives | |
acridest |
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
[ theycallmeswift ~/dev/personal/blah master ✔ ] NODE_ENV=test coffee features/visitor_views_the_website.coffee | |
error: Loading resource: Could not load resource at http://localhost:3000/404, got 404 - More: | |
Error: Could not load resource at http://localhost:3000/404, got 404 | |
·· error: Loading resource: Could not load resource at http://localhost:3000/500, got 500 - More: | |
Error: Could not load resource at http://localhost:3000/500, got 500 | |
·· ✓ OK » 4 honored (0.050s) | |
How can I get rid of those error messages ^^^^ |
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
# Cucumber doesn't like nested features (putting them into subdirectories) | |
# to fix this, add the following lines to config/cucumber.yml: | |
# --require features/step_definitions --require features/support | |
# SOURCE: http://collectiveidea.com/blog/archives/2010/09/13/practical-cucumber-organization/ | |
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip --require features/step_definitions --require features/support" | |
%> |
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
SomeController = (app) -> | |
MyModel = app.db.model 'MyModel' | |
# Streaming | |
app.get '/somethings', (req, res) -> | |
res.contentType('json') | |
somethingsStream = MyModel.find().stream() | |
somethingsStream.on 'data', (data) -> | |
res.send(JSON.stringify(data)) |
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
#!/usr/bin/env ruby | |
def factorial(n) | |
n == 0 ? 1 : n * factorial(n-1) | |
end | |
def R(n) | |
fact = factorial(n) | |
fact.to_s.split("").inject(0) { |sum, n| sum + n.to_i } | |
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
{ | |
"author": "", | |
"name": "1in7-cron-hour", | |
"description": "cron for 1in7", | |
"version": "0.0.0-2", | |
"repository": { | |
"url": "" | |
}, | |
"engines": { | |
"node": "~0.6.9" |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.host; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" |
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
// Twilio should be a constructor so you can instantiate multiple account connections. | |
var Twilio = require('twilio-js') | |
, twilioConnection1 = new Twilio("ACxxxxxxxxxxxxxxxxxxxxxx1", "xxxxxxxxxxxxxxxxxxxxxxxxx") | |
, twilioConnection2 = new Twilio("ACxxxxxxxxxxxxxxxxxxxxxx2", "xxxxxxxxxxxxxxxxxxxxxxxxx"); |
OlderNewer