Skip to content

Instantly share code, notes, and snippets.

View jefferyto's full-sized avatar

Jeffery To jefferyto

View GitHub Profile
@jefferyto
jefferyto / 00-button
Last active February 3, 2024 08:30
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
# 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 / .gitconfig
Last active November 17, 2018 17:38
What would I do without my aliases?
[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
@jefferyto
jefferyto / fonts.conf
Created May 14, 2013 11:38
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
<?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 October 7, 2012 14:27
Open Data table to run a query and stringify its return value
<?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>