Skip to content

Instantly share code, notes, and snippets.

View nailor's full-sized avatar

Jyrki Pulliainen nailor

View GitHub Profile
@nailor
nailor / pagefetcher.py
Created March 20, 2011 21:14
Script that fetches pages from search.twitter.com as long as there's something to fetch
#!/usr/bin/python
import json
import urllib
import sys
def fetch_pages():
i = 1
while True:
result = urllib.urlopen('http://search.twitter.com/search.json?%s' % (
;; -*- emacs-lisp -*-
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/Users/jyrki/.emacs-lib/pychecker.sh" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
#! perl -w
# http://triplefusion.net/system/macosx-clipboard
# ----------------------------------------------------------------------
# File: macosx-clipboard
# ----------------------------------------------------------------------
#
# All portions of code are copyright by their respective author/s.
# Copyright (c) 2006 Samuel Ljungkvist <salj@triplefusion.net>
#!/usr/bin/perl
# Author: Bart Trojanowski <bart@jukie.net>
# Website: http://www.jukie.net/~bart/blog/urxvt-url-yank
# License: GPLv2
use strict;
use warnings;
my $url_matcher = qr{(
(?:https?://|ftp://|news://|mailto:|spotify:|file://|www\.)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+
(defun single-window-mode ()
(interactive)
(delete-other-windows)
(set-frame-size (selected-frame) 80 65))
(defun double-window-mode ()
(interactive)
(delete-other-windows)
(set-frame-size (selected-frame) 163 65)
(split-window (selected-window) 83 t))
#!/usr/bin/env python
import sys
import time
from tornado.ioloop import IOLoop
def printer(digit):
def _do_print():
print digit
@nailor
nailor / .pdbrc
Created August 4, 2011 16:18 — forked from esamattis/.pdbrc
What every python developer should have in their ~/.pdbrc
# Enable tab completion
import rlcompleter
import pdb
pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
# Sometimes when you do something funky, you may lose your terminal echo. This
# should restore it when spanwning new pdb.
import termios, sys
termios_fd = sys.stdin.fileno()
termios_echo = termios.tcgetattr(termios_fd)
@nailor
nailor / bieberizer.sh
Created September 2, 2011 15:22
Bieberizer! for Reaktor Dev Day (by @nailor and @mikharj)
#!/bin/sh
echo "Bieberizing. Please wait..."
git reset --soft `git log --pretty=oneline | tail -n 1 | awk '{ print $1 }'`; git commit --amend -m "Implemented the software as specified." --author="Justin Bieber <justin@taiste.fi>"
echo "Done & Done"
require 'sass'
module Sass::Script::Functions
def inline_image(image, type)
path = image.value
image_data = [data(path)].flatten.pack('m').gsub('\n', '')
declaration = "url('data:#{type};base64,#{image_data}')"
Sass::Script::String.new(declaration)
end
declare :inline_image, :args => [:string, :string]
@nailor
nailor / couch.ini
Created October 4, 2011 12:50
Minimum configuration to start couchdb
[couchdb]
database_dir = tmp/couch
view_index_dir = tmp/couch
[httpd]
port = 8922
bind_address = 127.0.0.1
[log]
file = tmp/couch.log