Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / Cargo.toml
Created Mar 8, 2017
HK text extractor
View Cargo.toml
[package]
name = "hk"
version = "0.0.1"
[dependencies]
byteorder = "1.0"
xml-rs = "0.4"
@IgnoredAmbience
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active Nov 26, 2020
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.
Usage:
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
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.
Usage
@minrk
minrk / nbstripout
Last active Nov 9, 2020
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
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

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:

@ajvpot
ajvpot / gist:3115176
Created Jul 15, 2012
Minecraft Migrated Account Session Vulnerability
View gist:3115176
                  ████▓               
               ▓█▓▓▓▓▓██▒              
             ▒██▒▒▒▒▒▒▒▓█▓             
            ▓█▓▒▒▒▒▒▒▒▒▒▒██            
           ██▒▒▒▒▓███▓▒▒▒▒▓█▒          
         ▒█▓▒▓▓▓██▓░▓█▓▓▓▓▓▓█▓         
        ▓█▓▓▓▓▓██▓   ▒██▓▓▓▓▓██▒       
      ▒██▓▓▓▓███       ███▓▓▓▓██▓      
     ▓██▓█████▒         ▒█████████     
   ▒█████████  ▒▓▓▓▓▓▓▓▓▒▓█████████▒   
@lensco
lensco / Custom.css
Created Aug 18, 2011
User stylesheet to customize the WebKit Inspector (cleaning up and improving the styles panel). See http://bricss.net/post/9076968710/customize-the-webkit-inspector-chrome-dev-tools
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
martinth / assertion_hook.py
Created Aug 8, 2011
A sample exception hook, that prints useful information if an AssertionError occures
View assertion_hook.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os.path
import pprint
sys._old_excepthook = sys.excepthook
def assert_hook(exc_type, exception, traceback):
@jtriley
jtriley / terminalsize.py
Created Jul 26, 2011
Get current terminal size on Linux, Mac, and Windows
View terminalsize.py
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
You can’t perform that action at this time.