Skip to content

Instantly share code, notes, and snippets.

View ssokolow's full-sized avatar

Stephan Sokolow ssokolow

View GitHub Profile
@ssokolow
ssokolow / StyleSheet.css
Created July 27, 2011 23:49
Print CSS enhancements for TiddlyWiki
/* Blockquote margins are too fat */
.viewer blockquote { margin-left: 1em; }
.viewer blockquote blockquote { margin-left: 0.5ex; }
/* I think in-tiddler bordered elements (tables and pre blocks)
* should line up */
.viewer table, .viewer table.twtable { margin-left: 0.5em; }
/* Bullet my checklists with the checkboxes so they look nicer both
* on screen and in print */
@ssokolow
ssokolow / gist:1133645
Created August 9, 2011 09:14
XDG Basedir wrapper for Crayon Physics Deluxe
#/bin/sh
# XDG Base Directory Spec wrapper for Crayon Physics Deluxe as included in the
# Humble Indie Games Bundle 3
#
# Useful for hiding the non-hidden "Crayon Physics Deluxe" folder the game uses
# to store saved solutions
# Set this to where you installed Crayon Physics Deluxe
GAME_ROOT=~/opt/CrayonPhysicsDeluxe
@ssokolow
ssokolow / user.js
Created November 3, 2011 13:21
al_9x's updated Google Instant killer, adjusted to apply to encrypted.google.com too
user_pref("noscript.surrogate.google_preview.sources", "@^https?://(www|encrypted)\.google\.com/search\?(?!(?:.*&)?tbm=[^&]+)");
user_pref("noscript.surrogate.google_preview.replacement", "addEventListener('DOMContentLoaded', function(e) {Array.forEach(document.getElementsByClassName('vsc'), function(e) {if (e.tagName === 'DIV' && e.hasAttribute('sig')) e.removeAttribute('sig');}); Array.slice(document.getElementsByClassName('vshid')).forEach(function(e) {if (e.tagName === 'SPAN' && !(e.previousElementSibling && e.previousElementSibling.tagName === 'SPAN' && e.previousElementSibling.classList.contains('gl')) && e.firstElementChild) {e.classList.remove('vshid'); e.classList.add('gl'); e.insertBefore(document.createTextNode(' - '), e.firstElementChild);}});}, true); addEventListener('load', function(e) {var count = typeof e === 'number' ? e : 1; var els = Array.slice(document.getElementsByClassName('vspib')); if (els.length) els.forEach(function(e) e.parentNode.removeChild(e)); else if (++count <= 2) setTimeout
@ssokolow
ssokolow / google_redirect_killer.xml
Created November 8, 2011 22:52
Custom HTTPS Everywhere rule for bypassing Google's tracking redirects
<ruleset name="Kill Google Redirect Tracking">
<!-- Only one wildcard allowed. Borrowed from
https://gitweb.torproject.org/https-everywhere.git/blob_plain/HEAD:/src/chrome/content/rules/Google.xml
-->
<target host="*.google.com"/>
<target host="google.com"/>
<target host="www.google.com.*"/>
<target host="google.com.*"/>
<target host="www.google.co.*"/>
<target host="google.co.*"/>
@ssokolow
ssokolow / ncmv.sh
Created December 5, 2011 15:34
File-moving wrapper with netcat and tar
#!/bin/sh
# Light-weight script for moving files across a network
#
# To use:
# 1. Make sure tar, netcat, and pv are installed.
# 2. Edit TARGET_IP and TARGET_PORT
# 3. Run with `--listen` on the target machine.
# 3. Run with files/folders to move as arguments on the source machine.
#
# Troubleshooting:
@ssokolow
ssokolow / png2pdf.py
Created December 26, 2011 16:07
Simple script for converting a set of PNGs into a PDF
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A simple tool for converting batches of PNG pages into a PDF file.
Usage:
1. Drop into the folder with the PNGs.
2. chmod +x png2pdf.py
3. Double-click it.
Requires:
@ssokolow
ssokolow / set_icon.py
Last active September 30, 2015 00:28
Simple script to set icons on locally-installed games in Desura.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple script to set icons on locally-installed games in Desura.
If the game's title in the Desura Play list is case-insensitive identical to
the title in your Linux launcher menu and the game appears in the Games
category of the system launcher menu, you can provide only the title and the
icon will be looked up.
Otherwise, you must provide both the title in Desura and the title, icon name,
@ssokolow
ssokolow / fix_pidgin_elementary.py
Created February 13, 2012 10:48
Fix-it script for Pidgin tray icon status under Lubuntu
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Quick-fix script for Pidgin status tray icon in Lubuntu"""
__appname__ = "Lubuntu Pidgin Tray Icon QuickFix"
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__version__ = "0.1"
__license__ = "MIT"
import os, re, sys
@ssokolow
ssokolow / .htaccess
Created April 1, 2012 04:59
Redirecting when the old URL may or may not support .htaccess
# The proper way to HTTP Redirect... but not all hosts listen to .htaccess (eg. GitHub Pages)
# Some hosts also provide a special redirect option in their hosting controls.
RedirectPermanent / http://www.newsite.com/
# Probably never used, but just to be thorough.
ErrorDocument 404 /404.html
@ssokolow
ssokolow / leds.py
Created June 10, 2012 17:57
Helper class and demo in Python for OpenPandora LEDs
#!/usr/bin/python
"""Simple OpenPandora LED wrapper with demo
By: Stephan Sokolow (deitarion/SSokolow)
LEDs on the left are (in order):
- sd1
- sd2
- wifi
- bluetooth