Skip to content

Instantly share code, notes, and snippets.

Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama

Keybase proof

I hereby claim:

  • I am ehedaya on github.
  • I am ehed (https://keybase.io/ehed) on keybase.
  • I have a public key ASDdibwA8vZnny94Jzxr76rqZ4iJrzzR0masf7hzoQ7rUQo

To claim this, I am signing this object:

@ehedaya
ehedaya / gist:8225164
Last active March 23, 2019 14:39
Whatever
¯\_(ツ)_/¯
@ehedaya
ehedaya / sort_for_duplicates.sh
Last active March 23, 2019 14:37
Simple script to go through all the files in a folder and move any that are identical to a "duplicates" folder. Identical is defined as having the same md5 hash. I used this to save space in a folder that had multiple copies of the same video clips I shot on my iPhone.
# Make a directory to hold any duplicates we find; this may result in "directory already exists" if running a second time.
mkdir duplicates
# Create an empty log file to hold hashes so we know which files we have seen before
log=/tmp/md5copylog-`date +%s`.log
touch $log
# For any file (can change this to *.MOV to do just .MOV files, for example)
for f in *.*;
do
@ehedaya
ehedaya / stats.js
Created January 8, 2017 16:25
median, mean, standard deviation underscore mixins
_.mixin({
median : function(data) {
if(data.length < 1) return 0;
var slot = (data.length+1) / 2;
if (slot % 1 === 0) {
return data[slot-1];
} else {
var lower = Math.floor(slot);
var upper = Math.ceil(slot);
return (data[lower-1] + data[lower-1]) / 2;
@ehedaya
ehedaya / emailHasher.php
Created July 20, 2017 18:00
PHP script to hash email addresses
<?php
$emails = $_POST['emails'];
if($emails) {
$lines = split("\n", $emails);
$output = array();
foreach($lines as $line) {
$normalized = trim(strtolower($line));
$crypto = $_POST['crypto'];
if(!$crypto || $crypto == "md5") {
$hash = md5($normalized);
@ehedaya
ehedaya / gist:7234639
Created October 30, 2013 15:33
Try period-laced variations of an input email
validateEmail = function(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
emailPeriodPossibilities = function(str) {
if(!validateEmail(str)) { return false }
var name = str.match(/^([^@]*)@/)[1];
var domain = str.match(/^([^@]*)@(.*)/)[2];
matches = [];
for(var i=1;i<name.length;i++) {
@ehedaya
ehedaya / randomize.sh
Created April 11, 2013 12:34
Prepend filenames with hash to randomize order
# change mask for different filetypes
for f in *.batch;
do
m=`shasum ${f} | awk '{print substr($1,0,6)}'`
echo "${f} -> ${m}_${f}"
mv $f ${m}_${f}
done;
@ehedaya
ehedaya / randomize.sh
Created February 2, 2013 17:15
Prepend files with short hash (to randomize alphabetization order)
for f in *.batch;
do
m=`shasum ${f} | awk '{print substr($1,0,6)}'`
echo "${f} -> ${m}_${f}"
mv $f ${m}_${f}
done;
@ehedaya
ehedaya / gist:3974870
Created October 29, 2012 16:55
Handy git aliases (sayForExample)
[alias]
lg = log --graph --all --format=format:'%C(bold red)%h%C(reset) - %C(bold green)%ad%C(reset) %C(white)%s%C(reset) %C(bold white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=short
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short