Skip to content

Instantly share code, notes, and snippets.

View offby1's full-sized avatar

Eric Hanchrow offby1

View GitHub Profile
indent-to-column is an alias for `indent-to' in `subr.el'.
(indent-to-column COLUMN &optional MINIMUM)
Indent from point with tabs and spaces until COLUMN is reached.
Optional second argument MINIMUM says always do at least MINIMUM spaces
even if that goes past COLUMN; by default, MINIMUM is zero.
The return value is COLUMN.
#!/usr/bin/env python
"""Some documentation would be nice!"""
from __future__ import print_function
from __future__ import absolute_import
__author__ = 'eric.hanchrow@gmail.com'
import time
7/32
ASEP AP
CCL Correction
CCL Counts
Corrected Depth
Customer
DT01
Diff Tension
Drum Package
Drum Type
;; Also known as big-words, holla, yo-vinnie
(defun wat (wat)
"Create and switch to a buffer whose text is gi-normous.
Useful for signalling people across the room by showing them my
laptop screen."
(interactive "sSay what: ")
(switch-to-buffer "wat")
(text-scale-set 10)
(visual-line-mode t)
(erase-buffer)
(defun fix-it ()
(interactive)
(dolist (fixup '(( "ê" "\\\\^e")
( "é" "\\\\'e")
( "è" "\\\\`e")
( "á" "\\\\'e")
( "à" "\\\\`e")
( "í" "\\\\'i")
( "ó" "\\\\'o")
( "ã" "\\\\~a")
@offby1
offby1 / jbn.txt
Last active August 29, 2015 13:56
[joke #859]
A man is sent to IRC for the first time. On IRC, there's no sound or video, so a channel denizen goes over to the keyboard and types, "http://xkcd.com/12 !" The whole channel breaks out laughing. A few minutes later, somebody else on the channel yells, "http://xkcd.com/4 !" Again, the whole channel breaks out laughing.
The new guy asks the denizen what's going on. "Well," says the older IRCer, "we've all been in this here IRC for so long, we all know the same jokes. So we just yell out the number instead of saying the whole joke."
So the new guy walks up to the keyboard and types, "http://xkcd.com/6 !" There was dead silence in the channel. He asks the older IRCer, "What's wrong? Why didn't I get any laughs?"
"Well," said the older man, "sometimes it's not the joke, but how you tell it."
(Frankenstein'd from http://jokesareawesome.com/joke/859/a_man_is_sent_to_prison_for_the_first_t...)
# This seems quite similar to http://bugs.python.org/issue9127, but
# _that_ bug is fixed.
# The "close" call raises an IOError exception `No child processes` on
# Python 2.7.3 on 64-bit Ubuntu 12.04, as well as on Python 2.7.5 on
# OS X
import signal
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
f = open("watever.bin")
h = f.read().encode("hex")
for c in h:
print(c.encode("hex"))
15:44:54 [erich@ip-10-171-85-229 src]$ date --date='Tuesday 3rd September 2013'
date: invalid date `Tuesday 3rd September 2013'
:( 1 01:24:35 [erich@ip-10-171-85-229 src]$ date --date='3 September 2013'
Tue Sep 3 00:00:00 UTC 2013
:) 01:24:44 [erich@ip-10-171-85-229 src]$
#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
# From http://stackoverflow.com/questions/223678/git-which-commit-has-this-blob#223890
die "usage: git-find-blob <blob> [<git-log arguments ...>]\n"
if not @ARGV;