This file contains hidden or 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/ruby | |
# encoding: utf-8 | |
# Created: 2013-03-30 11:49:19 +0200 | |
# How often to check in seconds: | |
TIMEOUT = 10 | |
# Alert when lag is greates then in seconds: | |
LAG_MAX = 0.05 | |
STDOUT.sync = true |
This file contains hidden or 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
# Get the compile-dependencies of vim | |
sudo apt-get build-dep vim | |
# If you haven't got mercurial, checkinstall | |
sudo apt-get install mercurial checkinstall | |
# Get the source | |
hg clone https://vim.googlecode.com/hg/ vim | |
# Compile it | |
cd vim | |
./configure \ | |
--enable-luainterp=dynamic \ |
This file contains hidden or 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
# See "Lisp Macros in 20 Minutes" | |
# at http://www.slideshare.net/pcalcado/lisp-macros-in-20-minutes-featuring-clojure-presentation | |
# Ruby implementation var. 1 { | |
def from(names) | |
keys, vals = [], [] | |
i = -1 | |
names.each do |name| | |
r = yield name |
This file contains hidden or 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 'benchmark' | |
require 'set' | |
arr = [] | |
set = Set.new | |
1000.times do |_| | |
r = rand(1000) | |
arr << r | |
set << r |
NewerOlder