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 python | |
import time | |
import nose | |
from nose.plugins.base import Plugin | |
class NoseTimer(Plugin): | |
""" | |
Times each individual test and outputs them in reverse order of | |
speed (highest first) |
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
// pycon talk selection irc bot. | |
var irc = require('../../node-irc/lib/irc.js'); | |
var sys = require('sys'); | |
var imb0t = function () { | |
return { | |
pattern_list: [], | |
client: undefined, | |
position: -1, // starts at -1 so we can increment it on the first ,next to make it 0, which properly indexes |
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
package main | |
import ( | |
"tour/tree" | |
"fmt" | |
) | |
func Walk(tree *tree.Tree, ch chan int) { | |
if tree != nil { | |
Walk(tree.Left, ch) |
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 python | |
# Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349 | |
print "Color indexes should be drawn in bold text of the same color." | |
colored = [0] + [0x5f + 40 * n for n in range(0, 5)] | |
colored_palette = [ | |
"%02x/%02x/%02x" % (r, g, b) | |
for r in colored |
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
(defun if-string-match-then-result (to-match pairs) | |
"Takes a string to match and a list of pairs, the first element | |
of the pairs is a regexp to test against the string, the second of | |
which is a return value if it matches." | |
(catch 'break | |
(dolist (val pairs) | |
(if (string-match-p (car val) to-match) | |
(progn | |
(throw 'break (cadr val))))) |
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
* You and Your Research | |
http://www.cs.virginia.edu/~robins/YouAndYourResearch.html | |
** Necessities for Success | |
*** Courage | |
It seems as though the speaker said this as if this was also | |
synonymous with confidence. Asking impossible questions, etc. Maybe | |
brazenness would be a reasonable quality too. | |
*** Thinking | |
*** Age | |
Math folks are best when young. Composers best when old. His theory is |
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
Ideal online learning experience: | |
1. Lessons that are applicable to me. | |
a. CompSci data structures | |
b. CompSci algorithms | |
c. CompSci operating systems | |
d. CompSci (sensing a theme?) database design | |
2. Variety of questions which are in increasing difficulty (with approximate levels for each question) | |
3. The ability to have someone validate my answers (I'd pay for this, not sure if its per-question, per-lesson or per-"semester") | |
4. A bit of code that would evolve over the course of the "semester" |
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
2166 ± : ruby github-services.rb [7d0h36m] ✹ | |
WARN The gem environment is out-of-date or has yet to be bootstrapped. | |
Runnning script/bootstrap to remedy this situation... | |
bundle install requires at least 0 argument: "bundle install". | |
/Users/justinlilly/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find rake-0.8.7 in any of the sources (Bundler::GemNotFound) | |
from /Users/justinlilly/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:83:in `map!' | |
from /Users/justinlilly/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:83:in `materialize' | |
from /Users/justinlilly/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/definition.rb:113:in `specs' | |
from /Users/justinlilly/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib |
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
; setup dev environment w/ ponymode. | |
(defun pony-time () | |
(interactive) | |
(if virtualenv-workon-session | |
(progn | |
(pony-runserver) | |
(pony-manage-run '("celeryd" "-lINFO" "--traceback" "--autoreload")) | |
(pony-shell) | |
(sql-mysql)) |
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
def nice_time(delta): | |
""" | |
Gets time delta in seconds and returns a pretty string | |
representing it in the format of 1w2d9h16m44s | |
""" | |
weeks = 0 | |
days = 0 | |
hours = 0 |