Skip to content

Instantly share code, notes, and snippets.

View livibetter's full-sized avatar

Yu-Jie Lin livibetter

View GitHub Profile
@livibetter
livibetter / gentoo-countdown.svg
Created April 17, 2012 18:27
Gentoo Linux Infinity Countdown Timer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Country 2004 2005 2006 2007 2008 2009 2010 2011 2012
Afghanistan 163.07 163.07 160.23 157.43 154.67 151.95 151.5 149.2 121.63
Albania 21.52 21.52 20.75 20.02 19.31 18.62 15.11 14.61 14.12
Algeria 31 31 29.87 28.78 28.75 27.73 26.75 25.81 24.9
American Samoa 9.27 9.27 9.07 8.88 10.46 10.18 9.91 9.66 9.42
Andorra 4.05 4.05 4.04 4.03 3.68 3.76 3.84 3.8 3.76
Angola 191.19 187.49 185.36 184.44 182.31 180.21 178.13 175.9 83.53
Anguilla 21.03 21.03 20.32 19.61 3.54 3.52 3.49 3.47 3.44
Antigua and Barbuda 19.46 19.46 18.86 18.26 17.49 16.25 15.1 14.63 14.17
Argentina 15.18 15.18 14.73 14.29 11.78 11.44 11.11 10.81 10.52
@livibetter
livibetter / RESULTS
Created April 24, 2012 23:16
checking Blogger owned domains
blogger.ae YES
blogger.af YES
blogger.co.ao YES
blogger.asia YES
blogger.com.au YES
blogger.bf YES
blogger.bj YES
blogger.ca YES
blogger.cf YES
blogger.ch YES
@livibetter
livibetter / sleep.py
Created May 2, 2012 23:21
nargs and type check in argparse using sleep as example
#!/usr/bin/env python
# Written by Yu-Jie Lin
# Public Domain
import argparse
import re
import time
TU_SEC = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
RE_TIME_COMP = re.compile('(\d+)([%s])' % ''.join(TU_SEC.keys()), re.I)
@livibetter
livibetter / lspm.sh
Created May 15, 2012 07:50
Listing Python modules, columnated by Python versions
#!/bin/bash
# Listing Python modules, columnated by Python versions
# Written by Yu-Jie Lin
# Public Domain
list() {
echo "$1..." >&2
t="$(basename "$1")"
t=${t/python/}
# pydoc2.5 has only /usr/bin/python shebang line, has to run with correct
@livibetter
livibetter / obs.sh
Created May 18, 2012 03:09
Tracks recently obsessed with using Last.fm library
#!/bin/bash
# Written by Yu-Jie Lin
# Public Domain
#
# Check Last.fm library to see what recent tracks has been played consecutively
# for three times at least.
#
# Usage: obs.sh APIKEY USERNAME
if (( $# != 2 )); then
@livibetter
livibetter / COPYING
Created May 25, 2012 12:40
Using Google App Engine for quick visitor tracking via XMPP
Files in this Gist are written by Yu-Jie Lin and placed in Public Domain.
@livibetter
livibetter / rndeat.py
Created June 2, 2012 14:38
Random eats
#!/usr/bin/env python
# Copyright 2012 Yu-Jie Lin
# MIT License
#
# Requires:
# https://bitbucket.org/activestate/python-recipes/overview
from random import random
import argparse
@livibetter
livibetter / pygs.py
Last active April 17, 2023 09:18
Rendering this script with all Pygments styles for showing on my wiki
#!/usr/bin/env python3
# Rendering this script with all Pygments styles for showing on my blog at
# http://blog.yjl.im/2015/08/pygments-styles-gallery.html
# Written by Yu-Jie Lin, Public Domain
import sys
import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
@livibetter
livibetter / README.mkd
Created June 15, 2012 00:06 — forked from Goles/cliclock.sh
Command-line script for displaying world clocks, allows zonefiles or zone names inputs.

cliclock.sh

Command-line script for displaying world clocks, allows zonefiles or zone names inputs.

Forked from Gist, which was from an Stackoverflow answer.

Heavily modified by Yu-Jie Lin.