Skip to content

Instantly share code, notes, and snippets.

John Kristensen jerrykan

Block or report user

Report or block jerrykan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gogs_errors.log
---- Attempting to restart gogs ----
==> /var/log/gogs/gogs.log <==
2016/08/02 15:14:46 [I] Log Mode: File(Trace)
2016/08/02 15:14:46 [I] Cache Service Enabled
2016/08/02 15:14:46 [I] Session Service Enabled
2016/08/02 15:14:46 [I] Git Version: 2.1.4
==> /var/log/gogs/xorm.log <==
[xorm] [info] 2016/08/02 15:14:46.405516 [sql] SELECT tablename FROM pg_tables WHERE tablename = $1 [args] [version]
[xorm] [info] 2016/08/02 15:14:46.417816 [sql]SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = $1 AND column_name = $2[version id]
@jerrykan
jerrykan / git-diff-flake8.py
Created Sep 4, 2015
A very simplistic script to check for flake8 errors in the lines of a diff produced from `git diff`
View git-diff-flake8.py
#!/usr/bin/env python
"""
A very simplistic script to check for flake8 errors in the lines of a diff
produced from `git diff`. 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 / .travis.yml
Created Mar 17, 2015
.travis.yml file for roundup
View .travis.yml
language: python
python:
- "2.6"
- "2.7"
before_install:
# workaround mysql bug: http://bugs.mysql.com/bug.php?id=74901
# needed for test_mysql.mysqlDBTest.testFilteringSpecialChars
- sudo sed -i 's/utf8_unicode_ci/utf8_general_ci/' /etc/mysql/my.cnf
- sudo restart mysql
@jerrykan
jerrykan / Vagrantfile
Last active Aug 29, 2015
Vagrantfile for running roundup tests
View Vagrantfile
# -*- 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 ""'
View git_flake8_pre-commit
#!/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 / fairfax-stylish.css
Last active Aug 29, 2015
Hide the large boxes at the top of the Fairfax website that appear when javascript is not enabled
View fairfax-stylish.css
@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 / tweetdeck-stylish.css
Last active Aug 29, 2015
Stylish style to remove a lot of the whitespace from TweetDeck
View tweetdeck-stylish.css
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("tweetdeck.twitter.com") {
/*
* Column Headers
*/
.column-header {
height: 28px;
line-height: 28px;
}
View keybase.md

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:

View lwn_ebook.sh
#!/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
@jerrykan
jerrykan / activate
Last active Dec 31, 2015
Simple wrapper around virtualenv activate to set/unset environment variables
View activate
# Wrapper around virtualenv activate to set/unset environment variables
#
# Update the location of the virtualenv (VENV_DIR) and the environment variables
# to be set at the end of the script. Then use this script to init the
# virtualenv instead of the virtualenv version:
#
# $ source activate
#
# Virtualenv location
You can’t perform that action at this time.