Skip to content

Instantly share code, notes, and snippets.

(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($, _);
}
@djKianoosh
djKianoosh / mycd.sh
Last active November 6, 2015 20:30 — forked from leipzig/mycd.sh
directory based history bash profile
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 \
@djKianoosh
djKianoosh / hellostaticplug.ex
Last active January 6, 2016 13:25
Minimalistic elixir starter... index from priv, all other static from priv/static, and remaining catch all to hello world
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
@djKianoosh
djKianoosh / tmux.tips
Last active April 23, 2016 15:38
Basic tmux tips
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
@djKianoosh
djKianoosh / README.md
Created March 11, 2017 16:18
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
alias mp3='youtube-dl --extract-audio --audio-format mp3 --no-playlist -o "~/Desktop/Music/%(title)s-%(id)s.%(ext)s"'

Keybase proof

I hereby claim:

  • I am djkianoosh on github.
  • I am djkianoosh (https://keybase.io/djkianoosh) on keybase.
  • I have a public key ASCwJyxlFo_lDuS64Sf9PVRs0JAI6JUu0xE1oFgb1YKydQo

To claim this, I am signing this object:

@djKianoosh
djKianoosh / README.md
Created September 3, 2017 16:12 — forked from joyrexus/README.md
Nested grouping of arrays

nest.js

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.

@djKianoosh
djKianoosh / nfl_schedule.json
Last active September 4, 2017 00:21
NFL 2017-2018 Schedule in JSON array; from NFL.com's /ajax/scorestrip XML endpoint
[
[
{"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"},
@djKianoosh
djKianoosh / PuertoRico-Maria-2017-09-24.md
Last active September 25, 2017 16:07
Puerto Rico update as 9/24/2017

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.