Skip to content

Instantly share code, notes, and snippets.

View passy's full-sized avatar
😷
Wear a mask.

Pascal Hartig passy

😷
Wear a mask.
View GitHub Profile
/**
* Playground for building an http downloader.
*/
MainLoop loop;
class Download : Object {
string url;
Soup.SessionAsync session;
size_t total_length = 0;
Traceback (most recent call last):
File "/home/pascal/.virtualenvs/yoo/bin/commithero", line 9, in <module>
load_entry_point('CommitHero==0.1', 'console_scripts', 'commithero')()
File "/home/pascal/.virtualenvs/yoo/src/commithero/commithero/main.py", line 66, in main
repo.walk(vcs)
File "/usr/lib/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/test/test_support.py", line 628, in captured_output
yield getattr(sys, stream_name)
File "/home/pascal/.virtualenvs/yoo/src/commithero/commithero/main.py", line 63, in main
Traceback (most recent call last):
File "/home/pascal/.virtualenvs/yoo/bin/commithero", line 9, in <module>
load_entry_point('CommitHero==0.1', 'console_scripts', 'commithero')()
File "/home/pascal/.virtualenvs/yoo/src/commithero/commithero/main.py", line 66, in main
repo.walk(vcs)
File "/usr/lib/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/test/test_support.py", line 628, in captured_output
yield getattr(sys, stream_name)
File "/home/pascal/.virtualenvs/yoo/src/commithero/commithero/main.py", line 66, in main
# tell screen that you term can scroll
termcapinfo xterm ti@:te@
# bind Shift+PgUp/PgDn
bindkey -m "^[[5;2~" stuff ^b
bindkey -m "^[[6;2~" stuff ^f
using System;
using System.IO;
using System.Threading;
using System.Diagnostics;
namespace Born2Code.Net
{
/// <summary>
/// Class for streaming data with throttling support.
/// </summary>
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function push_edge() {
old_branch=`current_branch`
git stash save "Edgepush"
git checkout edge
git rebase $old_branch
@passy
passy / gist:740286
Created December 14, 2010 11:25
~/.vimrc
" Version 0.1 by Pascal. Lots of stuff copied from Armin Ronacher (mitsuhiko)
" http://dev.pocoo.org/~mitsuhiko/
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" No Compatibility. That just sucks
set nocompatible
set backspace=indent,eol,start
[ 16796.808] (WW) NVIDIA(0): WAIT (2, 6, 0x8000, 0x00006a8c, 0x0000ff14)
[ 16796.887] [mi] EQ overflowing. The server is probably stuck in an infinite loop.
[ 16796.887]
Backtrace:
[ 16796.902] 0: /usr/bin/X (xorg_backtrace+0x28) [0x45c5a8]
[ 16796.902] 1: /usr/bin/X (mieqEnqueue+0x1f4) [0x458ea4]
[ 16796.902] 2: /usr/bin/X (xf86PostMotionEventP+0xc4) [0x488d74]
[ 16796.903] 3: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f0490768000+0x5319) [0x7f049076d319]
[ 16796.903] 4: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f0490768000+0x5a0e) [0x7f049076da0e]
[ 16796.903] 5: /usr/bin/X (0x400000+0x6d4e7) [0x46d4e7]
I: client.c: Freed 10 "ALSA plug-in [chrome]"
D: alsa-sink.c: after: 3951
D: alsa-sink.c: Rewound 15804 bytes.
I: protocol-native.c: Connection died.
D: sink.c: Processing rewind...
D: sink.c: latency = 1273
D: sink-input.c: Have to rewind 15804 bytes on render memblockq.
D: source.c: Processing rewind...
D: sink-input.c: Requesting rewind due to corking
D: module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1b.0.analog-stereo becomes idle, timeout in 5 seconds.
@passy
passy / findnfs.py
Created May 18, 2011 15:01
Non-blocking way to find hanging processes using stale NFS file descriptors
#!/usr/bin/python
"""
Non-blocking way to find hanging processes using stale NFS file descriptors.
"""
import os
def main(path):
pids = []