Skip to content

Instantly share code, notes, and snippets.

View x-magic's full-sized avatar
🙂
Smiling

Bill Haofei Gong x-magic

🙂
Smiling
View GitHub Profile
@x-magic
x-magic / PoGDesignTVCalendarFooterMarginRemover.user.js
Last active January 21, 2018 12:49
The title is load and clear!
// ==UserScript==
// @name PoGDesign TV Calendar footer margin remover
// @namespace https://www.pogdesign.co.uk/cat/
// @version 0.1
// @description The title is load and clear!
// @author Some random guy
// @match https://www.pogdesign.co.uk/cat/*
// @updateURL https://gist.githubusercontent.com/x-magic/f9c8e5682c5fedcd03a0324c6c335fa6/raw/PoGDesignTVCalendarFooterMarginRemover.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/f9c8e5682c5fedcd03a0324c6c335fa6/raw/PoGDesignTVCalendarFooterMarginRemover.user.js
// ==/UserScript==
@x-magic
x-magic / ZeldaDungeonBreathoftheWildInteractiveMapTweaks.user.js
Last active November 22, 2018 17:06
Various hacks for Zelda Dungeon BotW map
// ==UserScript==
// @name Zelda Dungeon Breath of the Wild Interactive Map Tweaks
// @namespace http://www.zeldadungeon.net
// @version 0.1.1
// @description Various hacks for Zelda Dungeon BotW map. I'm just too lazy to write a full description.
// @include http*://www.zeldadungeon.net/breath-of-the-wild-interactive-map/*
// @run-at document-end
// @copyright Nope, this contains original code from the website. It's whether piracy or public domain. Sorry Zelda Dungeon. I love you guys!
// @updateURL https://gist.githubusercontent.com/x-magic/6c2d36d88b0f6fcc54b0615ab3700e53/raw/ZeldaDungeonBreathoftheWildInteractiveMapTweaks.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/6c2d36d88b0f6fcc54b0615ab3700e53/raw/ZeldaDungeonBreathoftheWildInteractiveMapTweaks.user.js
@x-magic
x-magic / MaharaDiaryEntryCompanion.user.js
Last active October 16, 2017 01:42
Change 9-column layout of diary entry page to fullwidth, then boost up the font size
// ==UserScript==
// @name Mahara Diary Entry Companion
// @namespace https://mahara.infotech.monash.edu.au/
// @version 0.1
// @description Change 9-column layout of diary entry page to fullwidth, then boost up the font size
// @include https://mahara.infotech.monash.edu.au/mahara/artefact/artefact.php?artefact=*
// @run-at document-end
// @copyright 2017, Bill Gong <haofei.gong@monash.edu>
// @updateURL https://gist.githubusercontent.com/x-magic/fad0a41f430783af6c898181081233c4/raw/MaharaDiaryEntryCompanion.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/fad0a41f430783af6c898181081233c4/raw/MaharaDiaryEntryCompanion.user.js
@x-magic
x-magic / TTGPointsCalculator.user.js
Last active March 16, 2024 05:30
Let me know how long does it takes to get 36,000 points on TTG
// ==UserScript==
// @name TTG Points Calculator
// @namespace https://totheglory.im/
// @version 0.2
// @description Let me know how long does it takes to get 36,000 points on TTG
// @match https://totheglory.im/mybonus.php
// @run-at document-end
// @copyright 2016, x-magic <xmagic5589@gmail.com>
// @updateURL https://gist.githubusercontent.com/x-magic/99035b660bbf180a26ac05c24aa4e861/raw/TTGPointsCalculator.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/99035b660bbf180a26ac05c24aa4e861/raw/TTGPointsCalculator.user.js
@x-magic
x-magic / TTGAddPersonalisedCategories.user.js
Last active April 1, 2024 00:25
Add direct link to specific category filter on navbar
// ==UserScript==
// @name TTG Add Personalised Categories
// @namespace https://totheglory.im/
// @version 0.8
// @description Add direct link to specific category filter on navbar
// @include https://totheglory.im/*
// @run-at document-end
// @copyright 2017-2023, x-magic <xmagic5589@gmail.com>
// @updateURL https://gist.githubusercontent.com/x-magic/a9c35a0b29b66c4e645b64a3caad6a2b/raw/TTGAddPersonalisedCategories.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/a9c35a0b29b66c4e645b64a3caad6a2b/raw/TTGAddPersonalisedCategories.user.js
@x-magic
x-magic / ZhihuIgnoreAllInvitation.user.js
Last active February 17, 2018 00:24
一个忽略知乎邀请页单页所有邀请的脚本(怎么读起来这么别扭……)
// ==UserScript==
// @name Zhihu Ignore All Invitation
// @namespace http://www.zhihu.com/
// @version 0.2.1
// @description Add a button to ignore all invitation
// @include http*://www.zhihu.com/question/invited*
// @run-at document-end
// @copyright 2016, x-magic <xmagic5589@gmail.com>
// @updateURL https://gist.githubusercontent.com/x-magic/04c6d7d87f7c934cd1c3fc102d6d8d63/raw/ZhihuIgnoreAllInvitation.user.js
// @downloadURL https://gist.githubusercontent.com/x-magic/04c6d7d87f7c934cd1c3fc102d6d8d63/raw/ZhihuIgnoreAllInvitation.user.js
@x-magic
x-magic / smstools-eventhandler.sh
Created November 19, 2016 06:33
SMS Server Tools 3 event handler script (mainly used for converting messages to UTF-8 encoding, for example, those messages with CJK characters included)
#!/bin/bash
#
# This script processes events from smsd.
# It mainly will converts SMS encoded with UCS2 encoding to UTF-8 format expected by many other applications.
# To use it, edit your /etc/smsd.conf and add the following line:
#
# eventhandler = /path/to/smstools-eventhandler.sh
#
# When a new message is received in /var/spool/incoming/, message files with following header line will be converted:
#
@x-magic
x-magic / mmvmysql.sh
Created August 7, 2016 06:27
Install MySQL in OSX, originally from http://git.io/eUx7rg, fixed the link used in the script (since it point to wrong file and leads the script to fail)
#!/bin/bash
#############################################
# AUTHOR: JONATHAN SCHWENN @JONSCHWENN #
# MAC MINI VAULT - MAC MINI COLOCATION #
# MACMINIVAULT.COM - @MACMINIVAULT #
# VERSION 2.2 RELEASE DATE SEPT 28 2015 #
# DESC: THIS SCRIPT INSTALLS MySQL on OSX #
#############################################
#REQUIREMENTS:
# OS X 10.7 or newer
@x-magic
x-magic / Shadowsocks4Debian.sh
Created July 6, 2016 11:25
Automated installation script to install Shadowsocks on Debian Jessie server (perfect for DigitalOcean droplet)
#!/bin/bash
# A script that automates Shadowsocks on a Debian Jessie server
# Perfect for and tested on DigitalOcean 512MB ($5/month) Debian Jessie x64 droplet, as of July 2016
# Since this is modifying systemd servie script so it won't work on Debian Wheezy
# Disable nfs and rpcbind service (this is just for DigitalOcean Debian distros since these services are useless!)
systemctl stop nfs-common > /dev/null 2>&1
systemctl disable nfs-common > /dev/null 2>&1
systemctl stop nfs-common > /dev/null 2>&1
@x-magic
x-magic / lyrics.php
Last active February 20, 2016 13:41
Download lyrics using geci.me's API @ https://github.com/solos/geci.me-api
<?php
error_reporting(0);
ini_set('display_errors', 0);
/* SQL for `lyrics` table
CREATE TABLE `lyrics` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`title` varchar(256) NOT NULL,
`artist` varchar(256) NOT NULL,
`lrc` varchar(256),