Skip to content

Instantly share code, notes, and snippets.

/*
* Who are the { parents, children, grandchildren, grandparents, siblings, ... } of { name }?
*
* Let's start with just a small set:
* Amy and Bob have children Carol, Doug, Erin
* Carol and Xavier have children Mike, Nina
*
* Amy + Bob <- we only care about genetic relations, don't fuss about the "+" as something we need!
* / | \
* Doug Erin Carol + Xavier
@mrpoptart
mrpoptart / .bash_profile.sh
Last active July 26, 2018 10:48
Today, bash_profile based task logger
# Create a log of what I did today at ~/.today
# Example:
# today I made a sandwich
# today I ate a sandwich
# cat ~/.today
# 2018-07-16 16:02:12 I made a sandwich
# 2018-07-16 15:59:28 I ate a sandwich
today(){
# make sure the file exists
touch ~/.today
#Gets the current branch and project name and uses that to compile a github URL that matches what you have open in Jetbrains
#jetbrains settings -> tools -> external tools
#program: /path/to/this/.file
#parameters: $ProjectFileDir$ $FilePathRelativeToProjectRoot$ $SelectionStartLine$ $SelectionEndLine$
#working directory: $ProjectFileDir$
open $(cd $1 && echo $(git config --get remote.origin.url | sed -e 's/git@/https:\/\//' | sed -e 's/\.net:/.net\//' | sed -e 's/.git$/\//')"blob/"$(git rev-parse --abbrev-ref HEAD)"/"$2#L$3-L$4)
@mrpoptart
mrpoptart / gist:9383586
Created March 6, 2014 06:30
Single-word text reader
function syl(word) {
word = word.toLowerCase();
if(word.length <= 3) return 1;
if(word.search(/\d/) != -1) return Math.floor(word.length/3);
word = word.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '');
word = word.replace(/^y/, '');
return word.match(/[aeiouy]{1,2}/g).length;
};
$('body').append('<div id="readdiv" style="padding:20px; font-size:30px; font-family:arial; width:600px; line-height:80px; position:fixed; top:20px; left:50%; margin-left:-300px; background-color:white;"></div>');
$readdiv = $('#readdiv');