Skip to content

Instantly share code, notes, and snippets.

Buried in Codes

Tim Zhang ttimasdf

Buried in Codes
View GitHub Profile
View 0001-remove-NX_NUMPROCS-case.patch
From 24b77f1f639727cb02cd0ef5b594aec94daeebfc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <>
Date: Tue, 19 Jun 2012 19:46:52 -0300
Subject: [PATCH 1/3] remove NX_NUMPROCS case
1) NX_NUMPROCS isn't supposed to be an event number, but just the number of
2) NX_NUMPROCS is > NX_LASTEVENT, so the "default:" branch already
handles it (and shows a warning)
csoma / gist:de71e151607940d6e523
Last active Dec 22, 2015
Remove GitHub Wiki page elements before printing
View gist:de71e151607940d6e523

GitHub Wiki updated Bookmarklet (Sep 2014)

Note: Will not work with Firefox, see bug #866522

Wiki - Hides extra panels:

martinlindhe / gdb.rb
Created Jun 29, 2016 — forked from Congee/gdb.rb
For gdb to execute python3 script on OSX 10.10 or later
View gdb.rb
class UniversalBrewedPython < Requirement
satisfy { archs_for_command("python").universal? }
def message; <<-EOS.undent
A build of GDB using a brewed Python was requested, but Python is not
a universal build.
GDB requires Python to be built as a universal binary or it will fail
if attempting to debug a 32-bit binary on a 64-bit host.
Takhion / build.gradle
Last active Dec 20, 2017 — forked from gabrielemariotti/build.gradle
Store APK signing credentials in an external file using Gradle
View build.gradle
android {
signingConfigs {
buildTypes {
release {
signingConfig signingConfigs.release
shvechikov /
Last active Jul 20, 2018 — forked from snehesht/Concurrent HTTP Requests with Python3 and asyncio
Concurrent HTTP Requests with Python3 and asyncio

Concurrent HTTP Requests with Python3 and asyncio

My friend who is a data scientist had wipped up a script that made lots (over 27K) of queries to the Google Places API. The problem was that it was synchronous and thus took over 2.5 hours to complete.

Given that I'm currently attending Hacker School and get to spend all day working on any coding problems that interests me, I decided to go about trying to optimise it.

I'm new to Python so had to do a bit of groundwork first to determine which course of action was best.

alexalouit / openwrt.squid.transparent
Last active Oct 13, 2018
OpenWRT Squid transparent configuration
View openwrt.squid.transparent
Squid required:
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache
Firewall section:
config redirect
option src 'lan'
option proto 'tcp'
option src_ip '!'
option src_dport '80'
option dest_ip ''
View Crosstool NG 1.22, Raspberry PI
$ git clone -b 1.22
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
$ mkdir ctng
$ cd rpi1
$ ct-ng menuconfig
evianzhow / shadowsocks-server
Last active Apr 27, 2019
shadowsocks-server OpenWRT init.d script
View shadowsocks-server
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 Jian Chang <>
# Copyright (C) 2016 Evian Zhow <>
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
ttscoff / rtftomarkdown.rb
Created Oct 9, 2012
Convert RTF/DOC files to Markdown via Textutil
View rtftomarkdown.rb
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Links are replaced with Markdown references (duplicate links combined).
meeech / gist:b2dafdb31f90160e833c
Created Jun 29, 2015
pick from whitelist of random themes for oh-my-zsh
View gist:b2dafdb31f90160e833c
#Add to your .zshrc right by ZSH_THEME
# Setup a random theme to load from a list I define
're5et' \
'sorin' \
'steeef' \
'dstufft' \
'random' \