Skip to content

Instantly share code, notes, and snippets.

@stelonix
stelonix / dubstep.net_rip.py
Created October 11, 2013 18:28
Dubstep.net site ripper. Works by scrapping, which might be illegal to use in some countries.
# All the configuration is done on the file
# It attempts to download tracks based on id, which I assume it's automatically incremented
# Very naive but it works
# Some of the code is based on code found in stackoverflow.com, all make it obvious in another revision
# TODO: Make the progress display better
import urllib2, lxml.html, traceback
from lxml.cssselect import CSSSelector
from sys import stdout
@stelonix
stelonix / opacity_zenity.py
Last active December 23, 2015 03:29
Simple Zenity slider to change current window transparency. Needs a better way to find the Window who called the script. Made for pekwm. Requires: transset-df, zenity and xprop. Rev 3: Now honors Zenity's return value
#!/usr/bin/python2
import sys, subprocess, os
from subprocess import PIPE, Popen
from threading import Thread
from Queue import Queue, Empty
def enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
@stelonix
stelonix / dmenu_recent
Last active December 21, 2015 14:48
sh script to make dmenu keep a list of recent entries. Originally posted by mnzaki on Arch Linux Forums (https://bbs.archlinux.org/viewtopic.php?pid=1112966#p1112966)
#!/bin/bash
# Originally based on code by Dieter Plaetinck.
# Pretty much re-written by Mina Nagy (mnzaki)
dmenu_cmd="dmenu $DMENU_OPTIONS"
terminal="urxvtc -e"
max_recent=199 # Number of recent commands to track
cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/dmenu-recent"
@stelonix
stelonix / ipython_log
Created November 19, 2012 00:16
Simple pygame tests
#!/usr/bin/env python
# log-default-2012-11-17.py
# IPython automatic logging file
# 17:33:23
# =================================
# =================================
# 17:35:06
# =================================
# =================================
# 17:36:39