Skip to content

Instantly share code, notes, and snippets.

View chenkaie's full-sized avatar
:octocat:
Build Something...

Kent Chen chenkaie

:octocat:
Build Something...
View GitHub Profile
@x43x61x69
x43x61x69 / Spotify.txt
Created January 14, 2018 14:18
Spotify Ads/Tracking Domains
adeventtracker.spotify.com
spclient.wg.spotify.com
d3rt1990lpmkn.cloudfront.net
adjust.com
doubleclick.net
googleadservices.com
googlesyndication.com
googletagmanager.com
googletagservices.com
google-analytics.com
@wjordan
wjordan / dockerize.sh
Last active June 22, 2020 15:47
Dockerize: A tiny replacement for Dockerfiles
#!/bin/sh
####
# Dockerize: A tiny replacement for Dockerfiles
# This script leverages `docker run` and `docker commit` to provide a usable workaround for
# restrictions of `docker build` and Dockerfile syntax to strictly host-independent builds.
#
# See these discussions:
# https://github.com/docker/docker/pull/1124
# https://github.com/docker/docker/issues/3156
# https://github.com/docker/docker/issues/3949
@fcwu
fcwu / supertrace.py
Last active November 6, 2016 13:24
#!/usr/bin/python
import gdb
INDENT = ' '
class SuperTrace(gdb.Command):
old_stack = []
def __init__(self):
@peterflynn
peterflynn / bookmarklet.js
Last active February 13, 2019 16:10
Bookmarklet to expand all collapsed comments in a GitHub pull request (places where it says "discussed an outdated diff")
// DEPRECATED: See "Expand All Comments" at https://gist.github.com/peterflynn/ace5dd3d7a8ec645cd42 for
// a more up to date, maintained version of this.
// Original bookmarklet from this gist (does not work anymore):
// javascript:(function() { $(".outdated-diff-comment-container").addClass("open"); }());
// Newer, working version (from link above as of Jan 2017):
// javascript:(function() { document.querySelectorAll(".outdated-diff-comment-container").forEach(function(n) {n.classList.add("open")}) }());
@bnoordhuis
bnoordhuis / results.txt
Created October 30, 2012 22:52
show difference between mmap() and malloc()
$ gcc -DUSE_MMAP=0 tmp/rss.c && ./a.out
rss 360448
==============
rss 360448
rss 1429504
rss 552960
==============
rss 552960
rss 1359872
rss 1359872
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@chenkaie
chenkaie / fdhijack.sh
Created December 2, 2011 18:00
Redirect stdin, stdout, stderr of a daemon to /dev/pts/#
#!/bin/sh
#
# Redirect stdin, stdout, stderr of a daemon to /dev/pts/#
#
#################################################################################################################
# Ref: stdio buffering: http://www.pixelbeat.org/programming/stdio_buffering/
# Default Buffering modes:
# stdin -> is always buffered
# stderr -> is always unbuffered
# if stdout is a terminal then buffering is automatically set to line buffered, else it is set to buffered