Skip to content

Instantly share code, notes, and snippets.

View pawelz's full-sized avatar

Paweł Zuzelski pawelz

View GitHub Profile
@pawelz
pawelz / gist:2016823
Created March 11, 2012 15:30
MITx YT links extractor
sed -n '/streams=/s#^.*function.*"1.0": "\([^"]*\)".*$#http://www.youtube.com/watch?v=\1#p' MITx\ 6.002x.html
@pawelz
pawelz / ex.py
Created February 5, 2012 02:32
Test case for typed script vars in ekg2
# vi:fenc=utf-8:sw=2:encoding=utf-8
import ekg
def testvars(name, args):
ekg.echo('varbool: %i' % ekg.config['varbool'])
ekg.echo('varint: %i' % ekg.config['varint'])
ekg.echo('varstr: %s' % ekg.config['varstr'])
ekg.echo('var: %s' % ekg.config['var'])
cat: ./-: No such file or directory
@pawelz
pawelz / gcd.sed
Created October 23, 2010 16:55
Euclidean algorithm implemented in pure sed.
#! /bin/sed -nf
# gcd.sed Copyright (c) 2010 by Paweł Zuzelski <pawelz@pld-linux.org>
# dc.sed Copyright (c) 1995 - 1997 by Greg Ubben <gsu@romulus.ncsc.mil>
# usage:
#
# echo N M | ./gcd.sed
#
# Computes the greatest common divisor of N and M integers using euclidean
@pawelz
pawelz / ww
Created September 6, 2010 13:20
15:13:33 [watch]_send: <message to="ww@example.pl" id="1283778813">
15:13:33 [watch]_send: <body>Mo#esz jeszcze raz cokolwiek do mnie napisa#? Mo#e mi si# uda podejrze# co si# dzieje z moim jabberem.</body>
15:13:33 [watch]_send: <x xmlns="jabber:x:event"><displayed/><composing/></x>
15:13:33 [watch]_send: </message>
15:13:33 [watch_handle_write] fd: 15 in queue: 226 bytes.... ... wrote:226 bytes (handler: 0xb7341e5a) left: 0 bytes
15:13:44 [jabber] jabber_handle_stream()
15:13:44 [jabber] (117b/117b) recv: <message from='ww@example.pl/Home' to='pzz@example.pl/ekg2' type='chat' id='purple9692c0ea'><body>123 test</body></message>
15:13:44 [jabber,message] type = chat
15:13:44 message_parse() s: xmpp:pzz@example.pl rec: xmpp:ww@example.pl/Home
15:13:44 [python] Getting value for 'notify:message_notify' config option
$ luakit
/home/users/z/.config/luakit/rc.lua:8: module 'globals' not found:
no field package.preload['globals']
no file './globals.lua'
no file '/usr/share/lua/5.1/globals.lua'
no file '/usr/share/lua/5.1/globals/init.lua'
no file '/usr/lib/lua/5.1/globals.lua'
no file '/usr/lib/lua/5.1/globals/init.lua'
no file './lib/globals.lua'
no file './lib/globals/init.lua'
void
sigchld(int signum) {
(void) signum;
if (signal(SIGCHLD, sigchld) == SIG_ERR)
fatal("Can't install SIGCHLD handler");
while(0 < waitpid(-1, NULL, WNOHANG));
}