Skip to content

Instantly share code, notes, and snippets.

View thedjinn's full-sized avatar

Emil Loer thedjinn

  • Hi Auto
  • Leeuwarden, Netherlands
View GitHub Profile
#!/usr/bin/env ruby
require "term/ansicolor"
include Term::ANSIColor
EXTENSIONS = ["swift", "m", "mm", "c", "cpp", "h", "hpp", "rb", "py", "js", "css", "coffee"]
filename_printed = false
Dir["**/*"].each do |filename|
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.011 000.011: --- VIM STARTING ---
000.122 000.111: Allocated generic buffers
000.398 000.276: locale set
000.405 000.007: clipboard setup
000.414 000.009: window checked
026.657 026.243: inits 1
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 4 2011 21:57:37)
MacOS X (unix) version
Compiled by djinn@pietbook.local
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
(djinn@pietbook)-(105/ttys020)-(00:04:16:26-09-11)-(~/code/fabutil)-(master)
$ cat fabfile.py
from fabutil import *
@task
def foo():
print "i'm in foo"
@task
def bar():
# We have four scores, two of them share the second place. This means the last
# one has to be pushed to the fourth place.
scores = [10, 9, 9, 8]
ranking, last_score, add = 0, 0, 1
rankings = scores.map do |score|
scores.index(score) + 1
end
require("./walk").walk(
"/path/to/a/directory",
function(file) {
console.log(file);
},
function(err) {
if(err) throw err;
console.log("Finished.");
}
);