Skip to content

Instantly share code, notes, and snippets.

💀
.

Jonathan Dahan jedahan

💀
.
Block or report user

Report or block jedahan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

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:

@jedahan
jedahan / update.zsh
Created Mar 19, 2017
weird update script
View update.zsh
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 <<<
View awesomebo.zsh
#!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
View colorful_hostname.zsh
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
View geometry_zsh_theme.patch
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
View hello_threaded_minifb.rs
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;
View r.zsh
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]};;
You can’t perform that action at this time.