Skip to content

Instantly share code, notes, and snippets.

View itayd's full-sized avatar
😽

Itay Donanhirsh itayd

😽
View GitHub Profile
@itayd
itayd / AutoKitteh_CLA
Last active May 16, 2022 04:35 — forked from CLAassistant/SAP_CLA
AutoKitteh Individual Contributor License Agreement
### AutoKitteh Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by AutoKitteh or its affiliates (“AutoKitteh”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to AutoKitteh in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact meow@autokitteh.com.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to AutoKitteh a non-exclusive
@itayd
itayd / parse_ptal.py
Created November 9, 2017 23:28
ptal parsing routine
from random import shuffle
from typing import Tuple, Set, Optional, List
from itertools import dropwhile, takewhile, tee
_PLEADS = [
'meow',
'ptal',
# etc
]
@itayd
itayd / gist
Created February 8, 2011 11:25
bash gist cli
#!/bin/bash
require() {
for what in $*; do
if !(which $what >& /dev/null); then
echo "error: $what is required to run this script, please install it"
exit 1
fi
done
}
@itayd
itayd / bardd.sh
Created February 8, 2011 11:22
dd
#!/bin/bash
[[ $# -lt 2 ]] && echo "usage: `basename $0` src target" && exit 1
which bar >& /dev/null
(( $? )) && echo "bar required" && exit 1
dd if=$1 bs=1M | bar -s 4g | dd of=$2 bs=1M
exit $?
@itayd
itayd / gridbrowse.hs
Created December 15, 2010 13:42
xmonad grid browser
-- grid browser
-- excerpt from xmonad.hs
gridBrowse cwd' = do
refresh
cwd <- liftIO $ canonicalizePath cwd'
isdir <- liftIO $ doesDirectoryExist cwd
if isdir
then do
ls <- liftIO $ getDirectoryContents cwd >>= markdirs
@itayd
itayd / sgs
Created December 15, 2010 11:40
summarized git status
#!/bin/bash
grn='\e[1;32m'
red='\e[0;31m'
cyn='\e[0;36m'
rst='\e[0m'
label=
tmpfn=/tmp/.sgs.$$
@itayd
itayd / gistcat
Created December 12, 2010 14:26
cat a file from gist, search by username + filename
#!/bin/bash
notags() {
while read line; do
echo $line | sed -e "s/<[^>]*>/ /g" -e "s/ / /g"
done
}
user=$1
wanted=$2
@itayd
itayd / flip.sh
Created November 23, 2010 15:40
flips second and rest of arguments for a command
#!/bin/sh
first=$1
second=$2
shift 2
after=$*
exec $first $after $second
@itayd
itayd / onchangedo.py
Created November 23, 2010 15:33
scans current directory, when a file's mtime is change, execute command in args concatinated to filename
#!/usr/bin/python
import os
import time
latest = {}
while True:
fs = os.listdir('.')
for f in fs:
@itayd
itayd / onchange.py
Created November 23, 2010 15:19
scans current directory, when a file's mtime is change, print it
#!/usr/bin/python
import os
import time
latest = {}
while True:
fs = os.listdir('.')
for f in fs: