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} |
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
PS1="\[\e[0;33;49m\]\n\W\[\e[0m\e[0;34;49m\] \$ \[\e[0m\]" |
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 'CMath' | |
URLSAFE_CHARS = '0123456789' + | |
'abcdefghijklmnopqrstuvwxyz' + | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def num_to_code(decimal_number, base=62) | |
raise "Invalid base" unless (2..62).include?(base) | |
raise ArgumentError unless decimal_number > 0 |
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 Cat < ActiveRecord::Base | |
validates :name, exclusion: { in: %w(Garfield Sylvester Tom Felix), | |
message: "No celebrity cat names allowed."} | |
validates :hair_length, inclusion: { in: %w(long_hair short_hair hairless), | |
message: "%{value} is not a valid hair length" } | |
validates :age, numericality: { only_integer: true, | |
message: "Only integer ages are allowed." | |
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 Object | |
def self.new_attr_accessor(*attr_names) | |
# Metaprogramming implementation of the | |
# self.attr_accessor class method | |
attr_names.each do |attr_name| | |
define_method(attr_name) do | |
instance_variable_get("@#{attr_name}") | |
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
class User | |
# ... clipped for brevity | |
def save | |
# Create a new row in the users table | |
if @id.nil? | |
QuestionsDatabase.instance.execute(<<-SQL, @fname, @lname) | |
INSERT INTO | |
users (fname, lname) | |
VALUES |