Skip to content

Instantly share code, notes, and snippets.

Jeffery To jefferyto

Block or report user

Report or block jefferyto

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
@jefferyto
jefferyto / legal-drinking-age.json
Created Jul 19, 2014
Legal drinking ages, to consume or purchase alcohol, for countries around the world. Based on data from https://en.wikipedia.org/wiki/Legal_drinking_age. If age depends on type of alcohol, state / province, etc., the oldest age is used. No minimum age is encoded as 0, "illegal" is encoded as null. I make no guarantees that this information is ac…
View legal-drinking-age.json
@jefferyto
jefferyto / 00-button
Last active Mar 14, 2019
Switching network configurations on a TP-Link TL-MR3020 with OpenWrt (12.09 Attitude Adjustment) using the sliding switch. Based on the sample scripts at: https://forum.openwrt.org/viewtopic.php?pid=172111#p172111 and https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
View 00-button
# based on
# https://dev.openwrt.org/browser/trunk/target/linux/atheros/base-files/etc/hotplug.d/button/00-button
# https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
. /lib/functions.sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
do_button () {
local button
@jefferyto
jefferyto / fonts.conf
Created May 14, 2013
Use Symbola over Android Emoji whenever possible in Ubuntu (and possibly other distros). Save as ~/.config/fontconfig (>=12.10) or ~/.fonts.conf (<=12.04), or save to the appropriate place in /etc to apply system-wide
View fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- Prefer Symbola over Android Emoji (or any other emoji font) -->
<alias>
<family>serif</family>
<accept>
<family>Symbola</family>
</accept>
</alias>
@jefferyto
jefferyto / toXMLString.xml
Created Oct 7, 2012
Open Data table to run a query and stringify its return value
View toXMLString.xml
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Jeffery To</author>
<description>Open Data table to run a query and stringify its return value</description>
<sampleQuery>select * from {table} where query='select * from html where url="http://www.yahoo.com/"' and xpath='//a'</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
@jefferyto
jefferyto / .gitconfig
Last active Nov 17, 2018
What would I do without my aliases?
View .gitconfig
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p --date=local
changes = diff --name-status -r
diffstat = diff --stat -r
gitkconflict = !gitk --left-right HEAD...MERGE_HEAD
You can’t perform that action at this time.