Skip to content

Instantly share code, notes, and snippets.

@djKianoosh
djKianoosh / tab.bash
Created December 14, 2017 14:58
Open new Terminal panes from the command line: will open horizontal tab; cursors will remain in originating pane (modification from https://gist.github.com/bobthecow/757788)
#!/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`
#
@djKianoosh
djKianoosh / date_scratch.sql
Last active November 1, 2017 15:24
Oracle Dates and (Sometimes Random) Intervals
WITH vals AS (
SELECT
SESSIONTIMEZONE,
CURRENT_DATE,
FLOOR(DBMS_Random.Value(1,120)) r1,
FLOOR(DBMS_Random.Value(1,120)) r2,
(CURRENT_DATE - FLOOR(DBMS_Random.Value(1,120)) / (24 * 60)) HOURSRND,
(CURRENT_DATE - INTERVAL '2' MINUTE) MINUTES2,
(CURRENT_DATE - INTERVAL '20' HOUR) HOURS20,
(CURRENT_DATE - INTERVAL '200' HOUR) HOURS200
@djKianoosh
djKianoosh / maria-dhs-response.md
Last active September 25, 2017 16:07
Hurricane Maria Response and Relief Operations Underway 9/22/2017

Hurricane Maria Response and Relief Operations Underway 9/22/2017

The U.S. Department of Homeland Security's Federal Emergency Management Agency’s (FEMA) top priority is to provide life-saving resources to Puerto Rico and the U.S. Virgin Islands, while aggressively working to gain greater access to disaster affected areas.

Federal coordinating officers and other FEMA personnel are on the ground, coordinating with the governors of the U.S. Virgin Islands and Puerto Rico, and their respective emergency management agencies.

@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.

@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 / 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.

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:

alias mp3='youtube-dl --extract-audio --audio-format mp3 --no-playlist -o "~/Desktop/Music/%(title)s-%(id)s.%(ext)s"'
@djKianoosh
djKianoosh / README.md
Created March 11, 2017 16:18 — forked from pcan/SelfExpiringHashMap.java
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
@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