Skip to content

Instantly share code, notes, and snippets.

piscisaureus /
Created Aug 13, 2012
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 =

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:

minrk / nbstripout
Last active Sep 21, 2021
git pre-commit hook for stripping output from IPython notebooks
View nbstripout
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain
jtriley /
Created Jul 26, 2011
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
SohamG / fonts.conf
Last active Aug 28, 2021
Fix emoji in Linux and get color emoji in Discord! Place this fontconfig file in ~/.config/fontconfig/fonts.conf
View fonts.conf
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- REQUIRES Noto fonts (along with Noto Color Emoji)
run `fc-list | grep -i -e "noto sans" -e "noto serif" -e "noto color emoji"` to confirm
<!-- Change the string in the family tag to whatever font -->
<prefer><family>Noto Serif</family></prefer>
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active Aug 27, 2021
Noto Emoji Color fontconfig for Konsole
View 99-noto-mono-color-emoji.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
ajvpot / gist:3115176
Created Jul 15, 2012
Minecraft Migrated Account Session Vulnerability
View gist:3115176
        ▓█▓▓▓▓▓██▓   ▒██▓▓▓▓▓██▒       
      ▒██▓▓▓▓███       ███▓▓▓▓██▓      
     ▓██▓█████▒         ▒█████████     
   ▒█████████  ▒▓▓▓▓▓▓▓▓▒▓█████████▒   
View emoji-font.css
Emoji - natural display for the web
These font face definitions allows to display emoji glyphs intermingled with
arbitrary characters outside emoji unicode blocks.
anonymous / Cargo.toml
Created Mar 8, 2017
HK text extractor
View Cargo.toml
name = "hk"
version = "0.0.1"
byteorder = "1.0"
xml-rs = "0.4"
lensco / Custom.css
Created Aug 18, 2011
User stylesheet to customize the WebKit Inspector (cleaning up and improving the styles panel). See
View Custom.css
.monospace {
font: 11px/1.3 Monaco !important;
/* slightly larger indentation of source code */
.outline-disclosure ol {
-webkit-padding-start: 18px !important;
/* margin underneath styles panel heading */
martinth /
Created Aug 8, 2011
A sample exception hook, that prints useful information if an AssertionError occures
# -*- coding: utf-8 -*-
import sys
import os.path
import pprint
sys._old_excepthook = sys.excepthook
def assert_hook(exc_type, exception, traceback):