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 / 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 / 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 / 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 / super-shake.cljs
Created September 13, 2012 12:30 — forked from foogoof/super-shake.cljs
Shakes a DOM element
(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)))))
@djKianoosh
djKianoosh / build.gradle
Created December 5, 2011 16:49 — forked from kellyrob99/build.gradle
build.gradle for setting up a new gradle-based project for use with clojure & clojuresque
apply plugin:'groovy'
apply plugin:'project-report'
buildscript {
repositories {
maven {
name 'clojars'
url 'http://clojars.org/repo'
}
}