SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
Original from: https://gist.github.com/pcan/16faf4e59942678377e0
apply plugin:'groovy' | |
apply plugin:'project-report' | |
buildscript { | |
repositories { | |
maven { | |
name 'clojars' | |
url 'http://clojars.org/repo' | |
} | |
} |
(defn super-shake [item value] | |
(start (apply bind item (mapcat (fn [dist] [{:effect :slide, :left dist, :time 375} | |
{:effect :slide, :left (- dist), :time 375}]) | |
(range 500 0 -100))))) |
function cd_dir_history() | |
{ | |
OLDPWD="$PWD" | |
echo "# $(date) $USER -> $@" >> "$HISTFILE" | |
command cd "$@" | |
# If this directory is writable then write to directory-based history file | |
# otherwise write history in the usual home-based history file. | |
touch "$PWD/.dir_bash_history" 2>/dev/null \ |
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
Original from: https://gist.github.com/pcan/16faf4e59942678377e0
A multi-level groupBy for arrays inspired by D3's nest operator.
Nesting allows elements in an array to be grouped into a hierarchical tree
structure; think of it like the GROUP BY
operator in SQL, except you can have
multiple levels of grouping, and the resulting output is a tree rather than a
flat table. The levels in the tree are specified by key functions.
See this fiddle for live demo.
#!/bin/bash | |
# | |
# Open new Terminal tabs from the command line | |
# | |
# Author: Justin Hileman (http://justinhileman.com) | |
# | |
# Installation: | |
# Add the following function to your `.bashrc` or `.bash_profile`, | |
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc` | |
# |