Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
RECIPE="$(dirname $0)/lwn_weekly.recipe"
OUTPUT="/tmp/LWN.net Weekly Edition [$(date +'%a, %d %b %Y')].mobi"
if [[ -z $LWN_USERNAME ]]; then
read -p "LWN Username: " LWN_USERNAME
fi
if [[ -z $LWN_PASSWORD ]]; then

Keybase proof

I hereby claim:

  • I am jerrykan on github.
  • I am jerrykan (https://keybase.io/jerrykan) on keybase.
  • I have a public key whose fingerprint is 2C5F 734B AA7E 8FEF 3F9E F9E9 174E FEED 9692 DF5F

To claim this, I am signing this object:

@jerrykan
jerrykan / tweetdeck-stylish.css
Last active August 29, 2015 14:08
Stylish style to remove a lot of the whitespace from TweetDeck
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("tweetdeck.twitter.com") {
/*
* Column Headers
*/
.column-header {
height: 28px;
line-height: 28px;
}
@jerrykan
jerrykan / fairfax-stylish.css
Last active August 29, 2015 14:08
Hide the large boxes at the top of the Fairfax website that appear when javascript is not enabled
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
domain("brisbanetimes.com.au"),
domain("canberratimes.com.au"),
domain("smh.com.au"),
domain("theage.com.au") {
#box-contact {
display: none;
}
@jerrykan
jerrykan / Vagrantfile
Last active August 29, 2015 14:17
Vagrantfile for running roundup tests
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
## init the environment
echo "deb http://http.debian.net/debian squeeze main" > /etc/apt/sources.list.d/squeeze.list
# Set MySQL root password
debconf-set-selections <<< 'mysql-server mysql-server/root_password password ""'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ""'
#!/usr/bin/env python
"""
A very simplistic script to check for flake8 errors in the lines of a file that
are to be committed. This is useful if you have files with lots of flake8
errors, but you only want to know about the errors in the lines you have
altered.
"""
import sys
import subprocess
@jerrykan
jerrykan / bash.git
Created April 30, 2012 04:19
Determine user logged in as root and export git env variables
#
# Export some environment variables so git can better determine the real user
# making commits when 'su'ed as the root user.
#
### Git Settings
USERNAME=`who -m | cut -d ' ' -f 1`
# Set the git author name and email
GIT_AUTHOR_EMAIL=`who -m | awk -F ' ' '{print $1"@"$5}' | sed -e 's/[()]//g'`
@jerrykan
jerrykan / email_reminder.py
Created August 7, 2012 07:18
Script to send out emails about open issues in roundup
#!/usr/bin/python
#
# This script should be run from a cronjob.
#
import roundup.instance
from roundup import roundupdb
from roundup.mailer import Mailer
class ReminderEmails(object):
@jerrykan
jerrykan / create_issue.py
Created November 5, 2012 10:10
Example script to create a roundup issue
#!/usr/bin/env python
"""
This script will create a new issue with a file "attachment" in a demo roundup
instance. This should provide a basic example of how to programmatically create
an issue in your own tracker.
"""
import roundup.instance
from roundup.exceptions import Reject
from roundup.date import Date
@jerrykan
jerrykan / git_pep8_pre-commit_hook.py
Last active December 10, 2015 21:08
A very simplistic script to check for pep8 errors in the lines of a file that are to be committed. This is useful if you have files with lots of pep8 errors, but you only want to know about the errors in the lines you have altered.
#!/usr/bin/env python
"""
A very simplistic script to check for pep8 errors in the lines of a file that
are to be committed. This is useful if you have files with lots of pep8 errors,
but you only want to know about the errors in the lines you have altered.
"""
import sys
import subprocess