Test

There used to be a teaser, but I’m probably not going to post the actual thing in any reasonable timeframe, so I shall use this as a dumping ground for snippets not important enough to deserve even a gist.

“If ever there is tomorrow when we’re not together.. there is something you must always remember. You are braver than you believe, stronger than you seem, and smarter than you think. But the most important thing is, even if we’re apart.. i’ll always be with you.”

rustc -C prefer-dynamic
.meter-text { white-space: pre-wrap; }
launchctl stop com.apple.pboard
launchctl start com.apple.pboard
# requires ImageMagick
function img() {
    identify -format '<img src="%f" width="%w" height="%h" />' $1
}
:%s/\%xa0/ /ge
:%s/\%u2019/'/ge
:%s/\%u201c/"/ge
:%s/\%u201d/"/ge
ifconfig en0 | grep ether
sudo ifconfig en1 ether 12:34:56:78:9a:bc
while [[ $(date +%Y) -ne 2015 ]];do figlet $(($(date -j 0101000015 +%s)-$(date +%s)));sleep 1;clear;done;figlet Happy New Year!
javascript:(function(x){function%20f(n){return%20Math.round(n*1000)/1000;}alert("HP:%20"+f(x.hp)+"\nMP:%20"+f(x.mp)+"\nEXP:%20"+f(x.exp)+"\nGP:%20"+f(x.gp));}(angular.element(document.querySelector('.hero-stats')).scope().user.stats));
alias kd='ruby --external-encoding UTF-8 -S kramdown'
alias please="sudo"
sage: R = PolynomialRing(QQ, 'x')
sage: f = R.lagrange_polynomial([(0,1),(2,2),(3,-2),(-4,9)]); f
-23/84*x^3 - 11/84*x^2 + 13/7*x + 1
/def key_pgdn = /dokey_hpage
/def key_pgup = /dokey_hpageback
/def -b'^J' = /dokey_line
/def -b'^K' = /dokey_lineback
;; ...
/def -PCred -F -t'dragon'
/def -PCmagenta -F -t'#\d+'
#!/bin/bash
if [[ $# < 1 ]]; then
    echo "cr: args pl0x" >&2
    exit 1
fi
if g++ $1.cpp -O2 -Wall -o $1; then
    echo "cr: compile OK" >&2
    if [[ $# > 1 ]]; then
        ./$1 < $1-$2.in
    else
        ./$1 < /dev/stdin
    fi
fi
import Control.Applicative
import Control.Lens
import Control.Monad.Trans
import Control.Monad.Trans.State
import Control.Monad.Trans.Writer
import Data.Monoid

listTraversal :: Traversal' [a] a
listTraversal _    []     = pure []
listTraversal func (x:xs) = let newX = func x; newXs = listTraversal func xs in (:) <$> newX <*> newXs

getSeventh :: Int -> StateT Int (Writer (First Int)) Int
getSeventh = \a -> do
    modify (+1)
    i <- get
    lift . tell . First $ if i == 7 then Just a else Nothing
    return a

increaseSeventh :: Int -> State Int Int
increaseSeventh = \a -> do
    modify (+1)
    i <- get
    return $ if i == 7 then a+1 else a

main = do
    let x = [100,200..2000]
    print $ execWriter (execStateT (listTraversal getSeventh x) 0)
    print $ evalState (listTraversal increaseSeventh x) 0
on run {input, parameters}
    tell application "Firefox" to activate
    tell application "System Events"
        keystroke "|"
        delay 0.15
        key code 125
        key code 123
        delay 0.15
        keystroke "|"
        delay 0.15
        key code 125
        key code 123
        delay 0.15
        keystroke "|"
        delay 0.15
        key code 125
        key code 123
        delay 0.15
        keystroke "|"
        delay 0.15
        key code 125
        key code 123
        delay 0.15
        keystroke "|"
        delay 0.15
        key code 125
        key code 123
    end tell
    return input
end run