Skip to content

Instantly share code, notes, and snippets.

View jedahan's full-sized avatar
💀
.

Jonathan Dahan jedahan

💀
.
View GitHub Profile
@jedahan
jedahan / # etcher-cli - 2018-08-17_19-48-33.txt
Created August 18, 2018 00:19
etcher-cli (etcher-cli) on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for etcher-cli on macOS 10.13.6
Build date: 2018-08-17 19:48:33

Keybase proof

I hereby claim:

  • I am jedahan on github.
  • I am jedahan (https://keybase.io/jedahan) on keybase.
  • I have a public key ASD9QSJEJvXDlK3cFhj6QNXbGAKYGCB2Uk9SFlCPBSlP7Ao

To claim this, I am signing this object:

0xe4967936f6cc4e2be09e25012eebf4f614ba91b0
@jedahan
jedahan / update.zsh
Created March 19, 2017 17:09
weird update script
function up { # upgrade everything
uplog=$(mktemp -t up.XXXXXX)
(($+commands[tmux])) && {
tmux select-window -t update 2>/dev/null || tmux rename-window update
tmux split-window -d -p 40 -t update "echo  $uplog; tail -f $uplog"
}
function fun { (( $+functions[$1] || $+commands[$1] )) && echo -n "updating $2..." }
fun config 'dotfiles' && { config pull } &>> $uplog && c <<< 
fun zpm 'zsh plugins' && { zpm update } &>> $uplog && c <<< ▲
#!env zsh
set -e
function showhelp {
echo "$0 <encryption_key.bin> <encrypted_amiibo.bin> [seven_byte_uid] [--random]"
exit
}
function checksum {
[[ $#1 -eq 3 ]] || [[ $#1 -eq 4 ]] || showhelp
hash() {
local sum=0
primes=(1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191)
ord_period=$(printf '%d' "'.")
for i in {1..${#1}}; do
letter=${1[$i]}
ord=$(printf '%d' "'$letter")
sum=$(($sum + $primes[$i] * $primes[1 + $(($ord - $ord_period))]))
done
echo $sum
diff --git a/geometry.zsh b/geometry.zsh
index a857d4a..5ef1374 100644
--- a/geometry.zsh
+++ b/geometry.zsh
@@ -117,8 +117,13 @@ prompt_geometry_set_title() {
}
prompt_geometry_render() {
+ sum=0 # dumb hashing function
+ for i in ${#HOST}; do
extern crate minifb;
use std::thread;
use std::time::Duration;
use std::thread::sleep;
use minifb::WindowOptions;
const WIDTH: usize = 288;
const HEIGHT: usize = 160;
function r() {
$[RANDOM % 2] && {
(( ! $# )) && echo "$0 reviewer [cc [cc...]]" || \
echo EDITOR=true review -g -r $1 ${2+-c "${(j.,.)@[2,-1]}"}
} || {
local EDITOR=true
case $# in
0) echo "$0 reviewer [cc [cc...]]";;
1) review -g -r $1;;
*) review -g -r $1 -c ${(j:,:)@[2,-1]};;
function r() {
(( ! $# )) && echo "$0 reviewer [cc [cc...]]" || \
echo EDITOR=true review -g -r $1 ${2+-c "${(j.,.)@[2,-1]}"}
}