This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn arraylist->map¬ | |
"Converts an arraylist java object to a list" | |
[al] | |
(loop [finished-list {} | |
counter 0] | |
(if (>= counter (.size al)) | |
finished-list | |
(recur (into finished-list (.get al counter)) | |
(inc counter))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn key-with-value¬ | |
"Retrieves the first key that has the associated value" | |
[list-items value] | |
(first (filter (comp #{value} list-items) (keys list-items)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn contains-keys? | |
"True if all keys are contained within the map" | |
[maps keywords] | |
(let [map-list maps | |
all-keys keywords] | |
(if (empty? all-keys) | |
true | |
(if (contains? map-list (first all-keys)) | |
(recur map-list (rest all-keys)) | |
false)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn str->int | |
"Converts a string to an integer" | |
[string] | |
(Integer. (re-find #"\d+" string))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bla='\033[0;30m' | |
red='\033[0;31m' | |
gre='\033[0;32m' | |
yel='\033[0;33m' | |
blu='\033[0;34m' | |
mag='\033[0;35m' | |
cya='\033[0;36m' | |
whi='\033[0;37m' | |
nc='\033[0m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directories # | |
/build/ | |
/bin/ | |
target/ | |
# OS Files # | |
.DS_Store | |
*.class | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place in between head tag… --> | |
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Screen Capture to disk: | |
⌘ ⇧ 3 Screen to jpeg file on desktop | |
⌘ ⇧ 4 + Drag: Selection to jpeg file on desktop | |
⌘ ⇧ 4 + Spacebar: Window (click camera) to jpeg file | |
Screen Capture to clipboard: | |
⌘ ⇧ 3 + Ctrl: Screen to clipboard | |
⌘ ⇧ 4 + Drag + Ctrl: Selection to clipboard | |
⌘ ⇧ 4 + Spacebar + Ctrl Window (Camera effect) |