Skip to content

Instantly share code, notes, and snippets.

View adrianiainlam's full-sized avatar

Adrian Iain Lam adrianiainlam

View GitHub Profile
# Add your Python code here. E.g.
from microbit import *
import music
NOTE_B0 = 31
NOTE_C1 = 33
NOTE_CS1 = 35
NOTE_D1 = 37
NOTE_DS1 = 39
NOTE_E1 = 41
// ==UserScript==
// @name Hide Ads on Facebook
// @namespace https://tampermonkey.net/
// @version 1.27.20
// @description Hide sponsored feeds on Facebook
// @author KudoAmine edited by A I Lam
// @downloadURL https://gist.github.com/adrianiainlam/75ea1f92b763f4c1c6297157591f0d56/raw/hide-fb-ads.user.js
// @updateURL https://gist.github.com/adrianiainlam/75ea1f92b763f4c1c6297157591f0d56/raw/hide-fb-ads.user.js
// @match https://www.facebook.com/*
// @license MIT
// ==UserScript==
// @name Remove URL redirectors and tracking params
// @namespace https://github.com/adrianiainlam
// @description Remove URL redirectors and tracking params
// @include *
// @version 2.1
// @downloadURL
// @updateURL
// @grant none
// ==/UserScript==
@adrianiainlam
adrianiainlam / gov-pr-tr.sh
Created August 27, 2019 05:20
HK/PRC government press release translator - fixes the gov's English mistakes
#!/bin/bash
sed -E 's/(R|r)ule of law/\1ule by law/g' "$@"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
! Title: zh Content Farms List
! Redirect: https://gist.github.com/adrianiainlam/3a1d6376e2481a641b78f257d9d8f866/raw/zh-content-farms-list.txt
! Version: 20200623
! Expires: 3 days
!
! Bug reports, additions, questions, comments: Please leave a comment at
! <https://gist.github.com/adrianiainlam/3a1d6376e2481a641b78f257d9d8f866>
! or email "spam@adrianiainlam.tk".replace("spam","me").
!
! zh Content Farms List - A uBlock Origin filter consisting of
@adrianiainlam
adrianiainlam / xkcd_keyboard_nav.user.js
Last active March 6, 2019 15:08
xkcd keyboard nav - Navigate xkcd with your keyboard
/* xkcd keyboard nav - Navigate xkcd with your keyboard
*
* Copyright (c) 2015-2019 Adrian Iain Lam
* <spam@adrianiainlam.tk> s/spam/me/
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/txt/copying/ for more details.
@adrianiainlam
adrianiainlam / gtk.py
Last active November 10, 2015 19:02
Pygments lexer for C code with GTK+ types
# -*- coding: utf-8 -*-
"""
pygments.lexers.gtk
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for GTK+ in C.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
/* 9gag NSFW loader - Loads 9gag NSFW posts without login
*
* Copyright (c) 2015 Adrian Iain Lam <adrianiainlam@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of