🧙♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH_THEME_GIT_PROMPT_DIRTY='%Uλ%u' | |
ZSH_THEME_GIT_PROMPT_CLEAN='λ' | |
local lambda='%(?,%{$fg[green]%},%{$fg[red]%})$(parse_git_dirty)%{$reset_color%} ' | |
PROMPT="$lambda" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" These bindings allow my conceal characters to work both ways. So if I type | |
" @, it is actually translated to this. I have conceal set up to render this | |
" as @. So I essentially have my own flavour of JavaScript but only in my Vim. | |
" Fantastic. | |
" Returns a mapped version of the list. | |
" http://learnvimscriptthehardway.stevelosh.com/chapters/39.html#higher-order-functions | |
function! Mapped(fn, l) | |
let new_list = deepcopy(a:l) | |
call map(new_list, string(a:fn) . '(v:val)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LazyValue(fn) { | |
this.valueOf = fn; | |
} | |
function lazyArray(fn) { | |
return [new LazyValue(fn)]; | |
} | |
function cons(item, arr) { | |
return [item].concat(arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 101010 | |
1 111111 | |
-1 111010 | |
D 001100 | |
A 110000 M | |
!D 001101 | |
!A 110001 !M | |
-D 001111 | |
-A 110011 -M | |
D+1 011111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns webdev.item.model | |
(:require [clojure.java.jdbc :as db])) | |
(defn create-table [db] | |
(db/execute! | |
db | |
["CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\""]) | |
(db/execute! | |
db | |
["CREATE TABLE IF NOT EXISTS items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__________________________________ | |
< Money is the root of all wealth. > | |
---------------------------------- | |
\ __------~~-, | |
\ ,' , | |
/ \ | |
/ : | |
| ' | |
| | | |
| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ -f /tmp/throttle-check ]]; then | |
echo "Currently throttling at $(cat /tmp/throttle-check). (throttle-off to stop)" | |
else | |
echo "Not currently throttling. (throttle-on to start)" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Turns a number (in number or string form) into a string with commas used as | |
* a thousands separator. | |
* | |
* Example: 10000000 -> 10,000,000 | |
* | |
* @param {String|Number} num | |
* @return {String} | |
*/ | |
function formatNumberWithCommas(num) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ | |
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
cat >>~/.vimrc <<EOL | |
set nocompatible | |
call plug#begin() | |
Plug 'tpope/vim-sensible' |