Skip to content

Instantly share code, notes, and snippets.

@mjhoy
mjhoy / gist:8049885
Last active December 31, 2015 21:49
dom pedro II

Faisal bin Turki prodded the fire with an iron.

"Boulenger, tell me this. If a king is universally acknowledged an excellent statesman, but is eagerly overythown by his own people, is he really all that good?"

Boulenger chuckled. "Faisal, you are thinking of my friend Dom Pedro II."

"Yes."

@mjhoy
mjhoy / gist:8056045
Created December 20, 2013 15:07
dhows

Faisal bin Turki looked out over the Gulf.

"Boulenger, have you seen anything like our dhows sailing in the evening? I know of a carpenter here who builds them purely from his head. He does not measure. You only tell him it must have a capacity for so-and-so many packages of dates. Yet his are the most beautiful!"

Boulenger was scribbling. "Nature passe nourriture. Faisal, if I told you a lizard was 2.75 inches from snout to vent, with no fifth

@mjhoy
mjhoy / problem.js
Created March 24, 2014 11:42
js: new is problematic
function K() {
this.za = "ze";
};
console.log(new K()); // => K { za: "ze" }
K.D = function() {
this.la = "le";
};

Keybase proof

I hereby claim:

  • I am mjhoy on github.
  • I am mjhoy (https://keybase.io/mjhoy) on keybase.
  • I have a public key whose fingerprint is FBB6 73D7 2A0F E808 FDBC DFC2 F711 D0A2 4C69 F1DB

To claim this, I am signing this object:

@mjhoy
mjhoy / etags-drupal.sh
Created November 21, 2014 20:15
running etags for drupal
# so i remember, from this page: http://www.emacswiki.org/PhpMode
etags --language=php `find . -name "*.php" -or -name "*.inc" -or -name "*.module" -or -name "*.theme" -or -name \
"*.engine" -or -name "*.ini"` --language=JavaScript `find . -name "*.js" -and -not -name "*.min.js" -and -not -name \
"*.pack.js" -and -not -name "*_pack.js" -and -not -name "*_stripped.js" -and -not -name "*_mini.js" -and -not -name \
"swfobject.js" -and -not -name "cal.js" -and -not -path "*/tinymce/jscripts/*" -and -not -name "ext-*.js" -and -not -path \
"*/files/*" -and -not -path "*/editors/jce/*" -and -not -path "*/libraries/*" -and -not -path \
"*/modules/ckeditor/ckeditor/*" -and -not -path "*/modules/fckeditor/fckeditor/*" -and -not \
-path "*/com_virtuemart/js/*" -and -not -path "*/media/system/js/*" -and -not -path "misc/jquery.js"`
@mjhoy
mjhoy / output 2
Last active August 29, 2015 14:25
nix output
$ nix-env -iA nixpkgs.haskell-ng.packages.ghc7101
[.....lots of "installing" lines....]
installing ‘haskell-zoneinfo-0.5’
installing ‘haskell-zoom-0.1.0.1’
installing ‘haskell-zoom-cache-1.2.1.6’
installing ‘haskell-zoom-cache-pcm-0.3.0.1’
installing ‘zoom-cache-sndfile-1.1.0.1’
installing ‘zot-0.0.2’
@mjhoy
mjhoy / output
Created October 13, 2015 20:11
nix-shell output
shell.nix:
with (import <nixpkgs> {}).pkgs.haskellPackages;
{
xml-conduit = xml-conduit;
}
[mjhoy@mjh-air-2 xlsx-parse]$ nix-shell --dry-run
these derivations will be built:
/nix/store/zv7blfiwizipj8p519dmnpslp0lcll7i-perl-5.20.2.drv
@mjhoy
mjhoy / nix-out.txt
Created November 3, 2015 02:30
nix output
$ nix-env -e hello -vvv
adding path ‘/Users/mjhoy/.nix-defexpr/channels/nixpkgs’ to the search path
adding path ‘/Users/mjhoy/.nix-defexpr/channels/nixpkgs’ to the search path
adding path ‘/nix/store/1rn8whr57nnkcfaqf3v0d741prfcd8ky-nix-1.10/share/nix/corepkgs’ to the search path
evaluating file ‘/nix/store/1rn8whr57nnkcfaqf3v0d741prfcd8ky-nix-1.10/share/nix/corepkgs/derivation.nix’
evaluating file ‘/nix/store/9hi7j0a2ii2svzvbfc4iq0ybzyp4s25z-env-manifest.nix’
evaluating list element
evaluating list element
evaluating list element
#!/bin/bash
# Commit changes to ~/Dropbox/org
set -e
cd /Users/mjhoy/Dropbox/org
if git status | grep 'working directory clean'
then exit
@mjhoy
mjhoy / if-bound.hs
Created November 11, 2015 18:47
if-bound
ifBound :: SnapletISplice b
ifBound = do
inp <- getParamNode
let t = X.getAttribute "tag" inp
case t of
Nothing -> return mempty
Just t' -> do
st <- getHS
let s = lookupSplice t' st
case s of