Skip to content

Instantly share code, notes, and snippets.

View robjens's full-sized avatar

Rob J robjens

  • Netherlands
View GitHub Profile
@robjens
robjens / 01.asciidoc
Last active August 29, 2015 14:19
Zsh tips and tricks

Z-shell

Abstract

Zsh has an extremely powerful and flexible system of programmable widgets (zstyle), key bindings (bind), autocompletion (compinit), formatting (zformat), option parsing (zparseopts) and much more.

Some of the more well, and lesser known, parts or tidbits of wisdom I found out myself and researched online, shall be gathered here.

This assumes a baseline zsh with antigen setup leveraging the libraries found in oh-my-zsh.

@robjens
robjens / repl-light.clj
Last active August 29, 2015 14:19
Hoplon Light Table ops task for remote network repl (nrepl) connection establishment
#!/usr/bin/env boot
#tailrecursion.boot.core/version "2.3.1"
(deftask repl-light
"Launch nrepl in the project, and echo the port for remote connection"
[]
(set-env! :dependencies
'[;; order matters here
[org.clojure/clojure "1.6.0"]
(def srcpath "/dir/with/build/clojure/src/jvm/clojure/lang/")
(defn system [cmd writedata]
(let [proc (.. java.lang.Runtime (getRuntime) (exec (into-array cmd)))
isr (new java.io.InputStreamReader
(. proc (getInputStream)) "ISO-8859-1")
osr (new java.io.OutputStreamWriter (. proc (getOutputStream)))
baos (new java.io.ByteArrayOutputStream)]
(. osr (write writedata))
(. osr (close))
@robjens
robjens / globals.asciidoc
Last active August 29, 2015 14:19
Node.js packages

Global Packages

In Node.js global package installs should only be done for those tools where we need to have global $PATH access to that bin/executable. That is to say, when we need command line access to the command at any path in our file system tree.

The following list of packages are some commonly found in my global assembly:

coffee-script

clean, elegant and succinct JavaScript derivative: drop brackets and enter significant white space, often used by me for .litcoffee

nesh

REPL for node.js with autocomplete and color tree parsing of objects in JS and CS: highly modular

@robjens
robjens / base.edn
Last active August 29, 2015 14:19
Boot dependency definition files
[
[enlive "1.1.5"]
[alembic "0.3.2"]
[backtick "0.3.2"]
[cheshire "5.4.0"]
[instaparse "1.3.6"]
[me.raynes/fs "1.4.6"]
[swiss-arrows "1.0.0"]
[prismatic/schema "0.4.0"]
[prismatic/plumbing "0.4.2"]
@robjens
robjens / index.html
Last active August 29, 2015 14:19 — forked from d3noob/.block
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Collapsible Tree Example</title>
<style>
.node circle {
@robjens
robjens / index.html
Last active August 29, 2015 14:19 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
fill: none;
stroke: #aaa;
}
.node text {
@robjens
robjens / index.html
Last active August 29, 2015 14:19 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
@robjens
robjens / README.md
Last active August 29, 2015 14:19 — forked from mbostock/.block

This example builds a random tree using the Reingold-Tilford "tidy" algorithm, as described in "Tidier Drawings of Trees" and implemented by d3.layout.tree. As each node is added to the graph, it enters from the previous position of the parent node. Thus, the existing nodes and the new node transition smoothly to their new positions. The animation stops when 500 nodes have been added to the tree.