I hereby claim:
- I am tsujigiri on github.
- I am tsujigiri (https://keybase.io/tsujigiri) on keybase.
- I have a public key ASDoZj7EcveL5TUa3vaetTsx6AoCApMZf1n24-gWdeBPugo
To claim this, I am signing this object:
class NilClass | |
def method_missing(*_) | |
nil | |
end | |
end |
I hereby claim:
To claim this, I am signing this object:
IO.popen("tail -F -n 0 #{path}") do |file| | |
while true | |
line = file.readline | |
# do stuff with line | |
end | |
end |
# Maintainer: Helge Rausch <[email protected]> | |
# This script is licensed under the MIT license. | |
# https://gist.github.com/tsujigiri/5476281 | |
# | |
## Installation | |
# | |
# To install the Leap software, you first need to download the SDK for Linux | |
# from https://developer.leapmotion.com/downloads/leap-motion/sdk using your | |
# developer account. Unpack it, place the included .deb files in the same | |
# directory as this PKGBUILD and run `makepkg`. If all goes well this will |
# Calculates the German income tax from the taxable income ("zu versteuerndes | |
# Einkommen"). Valid for 2010-2012. | |
function est (zvE) | |
if (zvE < 8005) | |
0 | |
elseif (zvE < 13470) | |
y = (zvE - 8004) / 10000; | |
(912.17 * y + 1400) * y | |
elseif (zvE < 52882) | |
y = (zvE - 13469) / 10000; |
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'date' | |
require 'curb' | |
require 'nokogiri' | |
begin | |
curl = Curl::Easy.perform('http://mirror.fem-net.de/CCC/29C3/mp4-h264-HQ/') | |
html = Nokogiri::HTML.parse(curl.body_str) |
" Vim color file | |
" Maintainer: David Liang (bmdavll at gmail dot com) | |
" Last Change: November 28 2008 | |
" | |
" wombat256.vim - a modified version of Wombat by Lars Nielsen that also | |
" works on xterms with 88 or 256 colors. The algorithm for approximating the | |
" GUI colors with the xterm palette is from desert256.vim by Henry So Jr. | |
set background=dark |
-module(quicksort). | |
-export([quicksort/2]). | |
quicksort(List, SpawnFactor) when SpawnFactor > 0 -> | |
Self = self(), | |
Child = spawn(fun() -> quicksort(Self, List, SpawnFactor) end), | |
receive | |
{Child, SortedList} -> SortedList | |
end. |
-module(benchmark). | |
-export([call_n_times/4]). | |
call_n_times(N, Module, Function, Args) -> | |
call_n_times([], N, Module, Function, Args). | |
call_n_times(Data, 0, _, _, _) -> | |
io:format("average: ~p us~n", [lists:sum(Data) / length(Data)]), | |
io:format("fastest: ~p us~n", [lists:min(Data)]), | |
io:format("slowest: ~p us~n", [lists:max(Data)]); |
file = File.open("some_file.txt", "r") | |
pos = file.size | |
file.pos = pos | |
while pos >= 0 | |
if file.readchar == "\n" | |
line = file.readline | |
# do something with line | |
end | |
pos -= 2 | |
file.pos = pos |