Skip to content

Instantly share code, notes, and snippets.

View livibetter's full-sized avatar

Yu-Jie Lin livibetter

View GitHub Profile
@livibetter
livibetter / tinycon.js
Created February 7, 2012 22:53
Make drawFavicon public to bypass number type checking. Original repo: https://github.com/tommoor/tinycon
/*
* Tinycon - A small library for manipulating the Favicon
* Tom Moor, http://tommoor.com
* Copyright (c) 2012 Tom Moor
* MIT Licensed
* @version 0.2
*/
(function(){
@livibetter
livibetter / REE.examples.py
Created February 19, 2012 01:42
Making useful of REE. ^_*
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Yu-Jie Lin
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
@livibetter
livibetter / Labels.mkd
Created February 19, 2012 20:51
Blogger Labels

(If you want this on your blog, please read this post for instructions.)

@livibetter
livibetter / gentoo-useness.sh
Created March 5, 2012 06:06
Gentoo USEness
#!/bin/bash
# Written by Yu-Jie Lin
# This script is placed in Public Domain
#
# Dependency: eix
if ! type eix &>/dev/null; then
echo "Please emerge app-portage/eix first, eix is required tool." 1>&2
exit 1
@livibetter
livibetter / .gitignore
Created March 9, 2012 18:44
Script for checking link-ins with Google Webmaster Tools data
*.checked
*.links
*.csv
wtal.re.sh
#!/bin/bash
# Playing sounds by tapping
# Copyright (c) 2012 Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
@livibetter
livibetter / gentoo-countdown.svg
Created April 17, 2012 18:27
Gentoo Linux Infinity Countdown Timer
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)