Skip to content

Instantly share code, notes, and snippets.

function k(c){var i=0;window.addEventListener('keyup',(e)=>{var y=e.keycode;[38,38,40,40,37,39,37,39,66,65,13][i]==y?i==9?c():i++:i=y==38?1:0})}

make flags passed to `git am` configurable

See functions using git am

`zz` bindings for show mode, how to do that?

Don’t use capitalized bindings in notmuch-show [0/2]

As described in notmuch:id:87tvz8419r.fsf@jb55.com

Conflicts with search bindings:

type instance Element StoreFile = FilePath
type instance Element MatchFile = FilePath
type instance Element AppleMusicFile = FilePath
newtype StoreFile = StoreFile { unStoreFile :: FilePath }
deriving Show
newtype MatchFile = MatchFile { unMatchFile :: FilePath }
deriving Show
sequential :: [Int] -> Bool
sequential = all (==True) (zipWith beside xs (tail xs))
where
beside n1 n2 = abs (n2 - n1) == 1
{-
λ> sequential [1,2,3]
True
λ> sequential [3,2,1]
#!/usr/bin/env bash
set -e
get_mimetype(){
file --mime-type "$1" | sed 's/.*: //'
}
usage () {
printf "kindle-email <file.pdf>\n" 1>&2
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import System.ShQQ (sh)
script :: Int -> IO String
script x = [sh|
derp () {
printf "hello %d\\n" $x
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import System.ShQQ (sh)
script = [sh|
derp () {
printf "hello %s\\n" \$1
sha256sum Main.hs
#!/usr/bin/env bash
query=$(cat <<EOF
create temp table posted_dates_earned (posted_date date, total_earned decimal);
copy posted_dates_earned (posted_date, total_earned)
from stdin delimiter E'\t';
select posted_date, sum(total_earned) as total_earned
#!/usr/bin/env node
const tls = require('tls')
const execFile = require('child_process').execFile
const args = process.argv;
const user = args[2] || process.env.GMAIL_NOTIFY_USER
const pass = args[3] || process.env.GMAIL_NOTIFY_PASS
const cmd = args[4] || process.env.GMAIL_NOTIFY_CMD
sh :: Sh a -> IO a
sh = shelly . silently
getLastMonth :: IO Text
getLastMonth = do
today <- sh $ run "date" ["+%Y-%m-01"]
d <- sh $ run "date" [ "-d", today <> " - 1 month", fmt ]
return (T.init d) -- remove linefeed
where
fmt = "+%Y-%m-%dT00:00:00Z"