Some apps to install before moving forward:
Direct links included, if you trust me ;)
- Hookshot
- Adblock
//foreground color | |
public static final String BLACK_TEXT() { return "\033[30m";} | |
public static final String RED_TEXT() { return "\033[31m";} | |
public static final String GREEN_TEXT() { return "\033[32m";} | |
public static final String BROWN_TEXT() { return "\033[33m";} | |
public static final String BLUE_TEXT() { return "\033[34m";} | |
public static final String MAGENTA_TEXT() { return "\033[35m";} | |
public static final String CYAN_TEXT() { return "\033[36m";} | |
public static final String GRAY_TEXT() { return "\033[37m";} |
/* Here is your chance to take over Socrates! | |
Spend 10 minutes on each of the following hacks to the socrates website. | |
Enter them in the console to make sure it works and then save | |
your results here. | |
Choose a new pair for each. Add your names to the section you complete. | |
*/ |
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
var Zoo = { | |
animals: {}, | |
init: function(animalInput) { | |
for(index in animals) { | |
this.animals[animalInput[index].name] = animalInput[index].legs; | |
}; |
<snippet> | |
<content><![CDATA[ | |
<form action="/${1:url}" method="post"> | |
<input type="${2:text}" name="$3"> | |
<input type="${4:password}" name="$5"> | |
${6:<input type="submit" value="Submit">} | |
</form>$0 | |
]]></content> | |
<tabTrigger>frmzplz</tabTrigger> | |
<scope>text.html - ruby</scope> |
module GameOfLife | |
def self.play input, n | |
# return 42 if input == "the universe and everything" | |
@board = make_board_from input | |
n.times { age!; print_board; sleep(0.2) } | |
end | |
def self.age! | |
results = parse_cells | |
process results |
require "benchmark" | |
n = 10000 | |
arr = (1..1000).to_a | |
zip = arr.zip arr | |
hash = Hash[zip] | |
Benchmark.bm do |x| | |
x.report("%-30s" %["sampling array"]) { n.times do | |
arr.sample |
#!/usr/bin/env python | |
"""http://stevelosh.com/projects/t/#installing-t | http://bitbucket.org/sjl/t/""" | |
"""t is for people that want do things, not organize their tasks.""" | |
from __future__ import with_statement | |
import os, re, sys, hashlib | |
from operator import itemgetter | |
from optparse import OptionParser, OptionGroup |
#! /usr/bin/env boot | |
(set-env! :dependencies '[[compojure "1.5.0"] | |
[http-kit "2.1.8"]]) | |
(require '[compojure.core :refer [defroutes GET]]) | |
(require '[org.httpkit.server :refer [run-server]]) | |
(defroutes routes | |
(GET "/" [] "Hello World!")) |