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
(function (root, definition) { | |
var _module_name = "myModule"; | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery', 'lodash'], function($, _){ | |
return (root[_module_name] = definition($, _)); | |
}); | |
} else { | |
root[_module_name] = definition($, _); | |
} |
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 \ |
defmodule Hellostaticplug do | |
use Plug.Router | |
plug Plug.Static, at: "/static", from: :hellostaticplug | |
plug :match | |
plug :dispatch | |
get "/" do | |
Plug.Conn.send_file(conn, 200, "priv/index.html") | |
end |
tmux | |
<C-b> " -- splits top and bottom | |
<C-b> o -- switches between top and bottom | |
run lein repl in top | |
<C-c> v -- sets vim.slime tmux window/pane :0.0 for example | |
<C-c><C-c> to send current section to tmux pane | |
https://robots.thoughtbot.com/a-tmux-crash-course |
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
alias mp3='youtube-dl --extract-audio --audio-format mp3 --no-playlist -o "~/Desktop/Music/%(title)s-%(id)s.%(ext)s"' |
I hereby claim:
To claim this, I am signing this object:
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.
[ | |
[ | |
{"eid": "2017090700", "day": "Thursday", "time": "8:30", "home": "NE", "away": "KC"}, | |
{"eid": "2017091000", "day": "Sunday", "time": "1:00", "home": "BUF", "away": "NYJ"}, | |
{"eid": "2017091001", "day": "Sunday", "time": "1:00", "home": "CHI", "away": "ATL"}, | |
{"eid": "2017091002", "day": "Sunday", "time": "1:00", "home": "CIN", "away": "BAL"}, | |
{"eid": "2017091003", "day": "Sunday", "time": "1:00", "home": "CLE", "away": "PIT"}, | |
{"eid": "2017091004", "day": "Sunday", "time": "1:00", "home": "DET", "away": "ARI"}, | |
{"eid": "2017091005", "day": "Sunday", "time": "1:00", "home": "HOU", "away": "JAX"}, | |
{"eid": "2017091006", "day": "Sunday", "time": "1:00", "home": "MIA", "away": "TB"}, |
PUERTO RICO update as of 9/24/2017
•CURFEW / ALCOHOL LAW: Both continue indefinitely. Anyone who does not comply will be arrested and the penalty is 6 months in jail. Businesses that serve alcohol, are going to lose their license for 6 months. Exceptions to breaking the "curfew": medical emergencies only.
•GOVERNMENT COMMUNICATIONS: The network is reestablishing itself. There are two Gov. brigades with escorts, focused only to make way for the antennas so that telecommunications can be restored.
•CELLULAR NETWORK: The AT&T system had faults in the system by a blind cut on an optical fiber. Already the same was solved. T-Mobile managed to re-establish its network, just like Claro, the latter being the one that worked best at the moment. Also, it is recommended that people with I-Phone put the settings of their data in 3G.
•INTERNET: the underwater cable that provides service to the island is still being fixed.