Skip to content

Instantly share code, notes, and snippets.

Thorsten Ball mrnugget

View GitHub Profile
aroben / git-commit-editor.vim
Last active Jul 9, 2020
Vim script to show git commit diff in vertical split while writing commit messages
View git-commit-editor.vim
" Put this in your .vimrc and whenever you `git commit` you'll see the diff of your commit next to your commit message.
" For the most accurate diffs, use `git config --global commit.verbose true`
" BufRead seems more appropriate here but for some reason the final `wincmd p` doesn't work if we do that.
autocmd VimEnter COMMIT_EDITMSG call OpenCommitMessageDiff()
function OpenCommitMessageDiff()
" Save the contents of the z register
let old_z = getreg("z")
let old_z_type = getregtype("z")
t-mart / netrw quick
Last active Jul 5, 2020
A quick reference for Vim's built-in netrw file selector.
View netrw quick
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
Blackjacx /
Last active May 9, 2019
My Apple Software Stack
brianhempel / bench_rails_memory_usage.rb
Last active Apr 5, 2020
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
View bench_rails_memory_usage.rb
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
rdebath / README
Last active Jun 25, 2020
Original brainfuck distribution by Urban Müller
This archive contains the following programs:
bfc The compiler for the 'brainfuck' language (240 bytes!)
bfc.asm Source for the compiler
bfi The interpreter for the 'brainfuck' language
bfi.c Source for the interpreter (portable)
src/ Some example programs in 'brainfuck'
src/atoi.b Reads a number from stdin
src/div10.b Divides the number under the pointer by 10
src/hello.b The ubiquitous "Hello World!"
View how to screencapture and make animated gifs or

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

View gist:490f4e5a77e61b297284
(Chapters marked with * are already written. This gets reorganized constantly
and 10 or so written chapters that I'm on the fence about aren't listed.)
Programmer Epistemology
* Dispersed Cost vs. Reduced Cost
* Verificationist Fallacy
* Mistake Metastasis
The Overton Window
Epicycles All The Way Down
The Hyperspace Gates Were Just There
cloudaice / ssh.go
Created Apr 29, 2014
Golang 使用ssh连接服务器
View ssh.go
package main
import (
takeshixx /
Last active Jun 10, 2020
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
Author: takeshix <>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
import sys,struct,socket
from argparse import ArgumentParser
View jsbin.iyahuJU.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title>JS Bin</title>
canvas { border: 1px lightgray solid; }
body { margin: 0; }
You can’t perform that action at this time.