Skip to content

Instantly share code, notes, and snippets.

View michaelmhoffman's full-sized avatar

Michael Hoffman michaelmhoffman

View GitHub Profile
2251 21:44:30.236005 execve("/snap/bin/emacs", ["emacs", "--batch", "--quick"], 0x7ffc09b44230 /* 14 vars */) = 0
2251 21:44:30.236805 brk(NULL) = 0x560153de3000
2251 21:44:30.237154 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe73afab20) = -1 EINVAL (Invalid argument)
2251 21:44:30.237518 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63bc25c000
2251 21:44:30.237803 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
2251 21:44:30.238052 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
2251 21:44:30.238286 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=14311, ...}, AT_EMPTY_PATH) = 0
2251 21:44:30.238533 mmap(NULL, 14311, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f63bc258000
2251 21:44:30.238729 close(3) = 0
2251 21:44:30.238941 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
@michaelmhoffman
michaelmhoffman / config-ispell-hunspell-windows-workaround.el
Created June 10, 2020 02:15
Workaround for Emacs for unimplemented part of hunspell win32 listdicpath()
(require 'ispell)
(when (string-equal (getenv "LANG") "ENU")
(setenv "LANG" "en_US"))
;; XXX: hunspell doesn't work because Emacs wants to figure out where its
;; directories are, and for win32 hunspell 1.7.0, `hunspell -D` *never* runs listdicpath()
;; https://github.com/hunspell/hunspell/issues/669
;; to correct, copied this bit from ispell-find-hunspell-dictionaries and
@michaelmhoffman
michaelmhoffman / auto-insert-python.el
Last active August 25, 2020 14:47
Template for Python scripts
(defun new-copyright ()
"Generate new copyright string."
(format-time-string "Copyright %Y Michael M. Hoffman <michael.hoffman@utoronto.ca>"))
(define-auto-insert 'python-mode
`(
"Description: "
"#!/usr/bin/env python3.6" \n
"\"\"\"" (setq basename (buffer-file-basename)) ": " str \n
"\"\"\"" \n \n
@michaelmhoffman
michaelmhoffman / bioc2018.md
Last active July 26, 2018 15:03 — forked from jxtx/bioc2018.md
#bioC 2018 Conference Notes
@michaelmhoffman
michaelmhoffman / README.md
Created December 29, 2015 22:58 — forked from lindenb/README.md
sort KML for @michaelhoffman https://twitter.com/michaelhoffman/status/681959184573661185 sort each Placemark inside each Folder on key=styleUrl

##Usage:

xsltproc transform.xsl doc.kml

Test

$ xsltproc transform.xsl doc.kml |grep -E '(Folder|styleUrl)' | head
@michaelmhoffman
michaelmhoffman / simulation.R
Created August 18, 2015 01:17
Is R^2 for five datapoints > 0.8?
set.seed(2015-08-17)
sum(as.integer(lapply(seq(1000), function(i) summary(lm(y ~ x, list(y = runif(5), x = runif(5))))$r.squared > 0.8)))/1000