Skip to content

Instantly share code, notes, and snippets.

View andrulik's full-sized avatar
🏠
Working from home

Andrii Moskalenko andrulik

🏠
Working from home
View GitHub Profile
#!/bin/zsh
# Copyleft 2010 paradoxxxzero All wrongs reserved
# With contribution from James Ahlborn
# https://gist.github.com/752727
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ...
# From http://www.zsh.org/mla/users/2010/msg00692.html
# Token types styles.
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135
import sys
from time import time
from collections import defaultdict
t = time()
w = defaultdict(set)
[w["".join(sorted(s.strip().lower()))].add(s) for s in open(sys.argv[1])]
for i, l in w.iteritems():
print "".join(l)
print time()-t,'s'
@andrulik
andrulik / dropbox_client.sh
Created April 4, 2010 07:57
These are two scripts that enable you to remote control a PC using Dropbox
#!/bin/bash
touch input.txt
touch output.txt
echo -n "Enter Command: "
read INCOM
echo "$INCOM" > input.txt
while [ -f input.txt ];do
"Europe/Andorra",
"Asia/Dubai",
"Asia/Kabul",
"America/Antigua",
"America/Anguilla",
"Europe/Tirane",
"Asia/Yerevan",
"America/Curacao",
"Africa/Luanda",
"Antarctica/McMurdo",
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
# Geany's snippets configuration file
[Python]
for=for i in xrange(%cursor%):\n\t
doc=""" %cursor% """\n
elif=elif %cursor%:\n\t
else=else:\n\t%cursor%
if=if %cursor%:\n\t
from=from %cursor% import \n
main=if __name__ == '__main__':\n\t%cursor%
class=class %cursor%(object):\n\t""" Class doc """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass