Skip to content

Instantly share code, notes, and snippets.

View timfel's full-sized avatar
👨‍🍼
Parental leave through 2024

Tim Felgentreff timfel

👨‍🍼
Parental leave through 2024
View GitHub Profile
@timfel
timfel / *scratch*
Created June 16, 2012 13:58
pypy traceback
[translation:ERROR] Error:
[translation:ERROR] Traceback (most recent call last):
[translation:ERROR] File "../pypy/pypy/translator/goal/translate.py", line 308, in main
[translation:ERROR] drv.proceed(goals)
[translation:ERROR] File "/home/tim/Devel/projects/pypy/pypy/pypy/translator/driver.py", line 791, in proceed
[translation:ERROR] return self._execute(goals, task_skip = self._maybe_skip())
[translation:ERROR] File "/home/tim/Devel/projects/pypy/pypy/pypy/translator/tool/taskengine.py", line 116, in _execute
[translation:ERROR] res = self._do(goal, taskcallable, *args, **kwds)
[translation:ERROR] File "/home/tim/Devel/projects/pypy/pypy/pypy/translator/driver.py", line 285, in _do
[translation:ERROR] res = func()
@timfel
timfel / test.rb
Created June 5, 2012 15:08
when-crazyness
a, b, c = 0
t = 4
case t
when (a = 3), (b = 4), (c = 5)
# puts 1
end
puts a, b, c
@timfel
timfel / tfs_server.rb
Created May 7, 2012 16:12
inotify example
class TfsWatcher
def initialize(directory, host, port, recurse)
@i = Inotify.new
@f = Fam.new
@f.protocol "FAM"
@f.open host, port
recurse ? Find.find(directory) {|dir| add(dir) } : add(directory)
end
RPApplication subclass: #TestApp
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'TestApp'.
echoSomething
<get: '/'>
self error: 'Shows error info about me'.
export PATH=/usr/bin:/bin
echo "You have 10 seconds, then I'll start and take $[$1 + 1] screenshots and press space $1 times"
sleep 10
/usr/bin/import -window root "screen_0.jpg"
for i in `seq -w 1 $1`; do
xdotool key space
sleep 3
/usr/bin/import -window root "screen_${i}.jpg"
done
convert "screen_*.jpg" presentation_to_pdf.pdf
rm screen_*.jpg
require File.expand_path("../calculator.rb", __FILE__)
services = %w[172.16.59.95
172.16.59.124
172.16.59.243
172.16.57.39
172.16.58.233
172.16.57.12
172.16.56.214
172.16.59.172
~ maglev ✔ maglev-irb -f
irb(main):001:0> b = proc { p 1 }
=> #<Proc>
irb(main):002:0> b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):003:0> block = b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):004:0> block.class
=> ExecBlock
irb(main):005:0> block.class.primitive '_sourceString', '_sourceString'
127 Hours Gran Torino Pelham 123
14 Blades Green Hornet Percy Jackson
22 Bullets Green Zone PI
5 Days of War Gullivers Reisen Piranha
A Better Tomorrow Hanna Planet 51 (2009)
Adele und das Geheimnis des Pharaos Harry Potter 6 Rango
After Life Harry Potter und die Heiligtuemer des Todes Teil 1 R.E.D
Alles Erlaubt Hollywood Reality Red Riding Hood
Assault Girls Hunt to Kill Repo Men
Besouro I am number four Rio