Skip to content

Instantly share code, notes, and snippets.

View mwolson's full-sized avatar

Mike Olson mwolson

View GitHub Profile
@mwolson
mwolson / updating-man-database.md
Created October 21, 2016 01:30
Updating man database (for man -k) on OS X

After installing new packages, the M-x man command might not list the new manpages for those packages, because the whatis DB used by man gets updated weekly via a cron job. Further, any manpages for programs that are part of the XCode Commandline Tools will never get installed because the cron job inexplicably excludes them. To make force them to be generated, run the following:

sudo /etc/periodic/weekly/320.whatis
sudo /usr/libexec/makewhatis /Applications/Xcode.app/Contents/Developer/usr/share/man
@mwolson
mwolson / index.css
Created March 20, 2019 23:31
zoom image into a box preserving aspect ratio
.tc-ConversationItem[class] .tc-ConversationItem__avatar .tc-AvatarImage {
// modify these with something like calc(200%), or manual width/height "box" around the image
// which then gets zoomed to fit
width: 52px;
height: 52px;
}
.tc-AvatarImage[class].tc-AvatarImage--size--fit {
display: block;
width: 100%;
@mwolson
mwolson / pyramid.md
Created March 22, 2017 22:13
Test pyramid

Test pyramid

We want more of the (faster and/or easier to write) things at the bottom of the pyramid, and less of the (slower and/or harder to write) things at the top of the pyramid.

                        /\
                       /  \
                      /    \
 / security analysis
@mwolson
mwolson / swank-js-init.el
Last active December 15, 2015 01:19
Attaching to a swank-js node.js server using SLIME and Emacs
;; Improved Javascript support
(add-to-list 'load-path (concat my-emacs-path "/elisp/js2-mode"))
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;; Node REPL using SLIME
(add-to-list 'load-path (concat my-emacs-path "/elisp/slime"))
(add-to-list 'load-path (concat my-emacs-path "/elisp/slime/contrib"))
(require 'slime)
(autoload 'slime-js-minor-mode "slime-js" nil t)
@mwolson
mwolson / erc-solarized.el
Created December 4, 2012 22:08
Make ERC look nice with some themes
;;; Assumptions:
;;
;; - Solarized (dark) theme has already been loaded
;; https://github.com/sellout/emacs-color-theme-solarized
;;
;; - Nicks in ERC buffer before running this code may look weird.
;; New activity in ERC buffer after running this code should look OK.
(defun mwolson/make-erc-themeable ()
(interactive)
# Before
$ wrk -c 20 -t 6 -d 50s http://localhost:8181/health/healthcheck
Running 50s test @ http://localhost:8181/health/healthcheck
6 threads and 20 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 73.58ms 112.85ms 375.41ms 87.91%
Req/Sec 138.11 97.30 348.00 66.52%
41179 requests in 50.00s, 10.76MB read
Requests/sec: 823.57
Transfer/sec: 220.37KB
@mwolson
mwolson / local-node.sh
Created March 14, 2014 15:08
Run local compiled version of node.js in a shell, or execute some code with it
#!/bin/bash
export NODE_EXEC=/proj/helpers/node/node
export V8_PATH=/proj/helpers/node/deps/v8/out/native
if test -z "$1"; then
export PATH=/proj/helpers/node:"$PATH"
echo "Now using node $(which node); Ctrl+D to exit"
$SHELL
else