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 'net/https' | |
require 'json' | |
uri = URI('https://api.clever.com/v1.1/sections?limit=379') | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
request = Net::HTTP::Get.new(uri.request_uri) |
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 'openssl' | |
def gravitar_url(email) | |
base = 'http://www.gravatar.com/avatar/' | |
base + OpenSSL::Digest::MD5.new(email).to_s | |
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
var Cat = (function () { | |
var numberOfCats = 0; | |
var Cat = function (name) { | |
this.name = name; | |
numberOfCats += 1; | |
} | |
Cat.prototype.numberOfCats = function () { | |
return numberOfCats; |
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
// setInterval implemented using setTimeout | |
function mySetInterval(fn, delay) { | |
setTimeout(function () { | |
fn(); | |
mySetInterval(fn, delay); | |
}, delay) | |
} |
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
// In this gist, I explain how to achieve mutable shared state | |
// between "instances of a class", i.e. objects with a shared | |
// prototype. This mimics how "class variables" are used | |
// in other languages with classical inheritance. | |
// Not something you want to do all the time, obviously, but it could | |
// be handy in some situations. | |
function Cat() { | |
// increment the class variable each time a constructor is used. |
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
#!/bin/sh | |
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$") | |
if [ "$files" = "" ]; then | |
exit 0 | |
fi | |
pass=true | |
for file in ${files}; do |
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 'date' | |
class TimeSeries | |
attr_reader :data, :date | |
def initialize(data, date) | |
raise ArgumentError unless data.is_a?(Array) && date.is_a?(Date) | |
raise ArgumentError, "TimeSeries cannot be empty" if data.empty? | |
@data = data | |
@date = date |
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
http://jobs.37signals.com/ | |
http://42floors.com/jobs | |
http://www.fourthandgrand.com/jobs | |
http://www.500friends.com/jobs | |
http://www.72lux.com/careers.html | |
https://docs.google.com/a/appacademy.io/spreadsheet/viewform?formkey=dFhTLUJURWFqTmFDVkhGRm52VVZfNmc6MQ | |
http://www.academia.edu/hiring | |
http://www.accellion.com | |
http://www.achaogen.com/ | |
http://www.activelylearn.com/jobs |
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 TextAnalyzer | |
def initialize(raw_text) | |
@text = raw_text | |
self.normalize | |
@words = self.tokenize | |
end | |
def tokenize | |
@text.split(" ") | |
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
\documentclass[12pt]{article} | |
\usepackage{fullpage} | |
\usepackage{enumitem} | |
\usepackage{xhfill} | |
\usepackage[width=5.5in, height=9in]{geometry} | |
\pagestyle{empty} | |
\raggedbottom | |
\raggedright | |
\setlength{\tabcolsep}{0in} | |
\usepackage[colorlinks=true, urlcolor=red]{hyperref} |