Skip to content

Instantly share code, notes, and snippets.

View robjens's full-sized avatar

Rob J robjens

  • Netherlands
View GitHub Profile
@robjens
robjens / README.md
Last active August 29, 2015 14:19 — forked from mbostock/.block
@robjens
robjens / README.md
Last active August 29, 2015 14:19 — forked from mbostock/.block

Click to add nodes! Nodes near the cursor will be linked to the new node.

D3's force layout uses the Barnes–Hut approximation to compute repulsive charge forces between all nodes efficiently. Links are implemented as geometric constraints on top of position Verlet integration, offering greater stability. A virtual spring between each node and the center of the chart prevents nodes from drifting into space.

@robjens
robjens / README.md
Last active August 29, 2015 14:19 — forked from mbostock/.block

The tree layout implements the Reingold-Tilford algorithm for efficient, tidy arrangement of layered nodes. The depth of nodes is computed by distance from the root, leading to a ragged appearance. Radial orientations are also supported. Implementation based on work by Jeff Heer and Jason Davies using Buchheim et al.'s linear-time variant of the Reingold-Tilford algorithm. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

Compare to this radial layout.

@robjens
robjens / xml.ebnf
Created April 29, 2015 00:50
(E|A)BNF Collection (instaparse)
document ::= prolog element Misc*
Char ::= "\\u0009" | "\\u000A" | "\\u000D" | #"[\\u0020-\\uD7FF]" | #"[\\uE000-\\uFFFD]" | #"[\\u10000-\\u10FFFF]"
S ::= ("\\u0020" | "\\u0009" | "\\u000D" | "\\u000A")+
NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
Name ::= (Letter | '_' | ':') (NameChar)*
@robjens
robjens / 01.txt
Last active August 29, 2015 14:20
Graphgist
= Entitlements and Access Control Management
:neo4j-version: 2.2.0
:author: Kenny Bastani
:twitter: @kennybastani
:description: Graph database access control, entitlements, authorization solutions
:tags: domain:finance, use-case:access-control
This interactive Neo4j graph tutorial covers entitlements and access control scenarios.
'''
@robjens
robjens / decision.md
Created May 10, 2015 19:59
Golden rules

Decision-making process

These may serve as a reminder. I intend to stick to this and not rush into half-baked solutions before I know what the options are. Be advised :P

To increase the effectiveness of your decision-making, follow these steps:

  1. Define the problem
  2. Gather relevant information
  3. Develop alternatives and options
  4. Evaluate alternatives
@robjens
robjens / steps.asciidoc
Last active December 18, 2021 01:50
Grsec Arch Long Term Support Hacking

ArchLinux linux-grsec-lts

Prerequisites

Up-to-date OS

Always ensure you have the latest set of software (Arch is a rolling release system in case you didn’t know).

# In my case, enable `rw` mount of `/boot` or, if linux updates, will fail due to `ro` mode preventing write to disk partition
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
@robjens
robjens / 00.asciidoc
Last active August 29, 2015 14:22
F# Notes

F# Gotchas

  1. Really need to watch out with assumption that let x = someSeq |> Seq.filter isSomething will NOT produce a new value! Need to do …​ |> List.ofSeq to force a new value produced…​ this had me a few times by the nutsack

    1. Identity function (fun x → x) someValue

    2. Hence we can do: a |> b |> (fun c → c, new D(c), c.Foo())

Something like:

@robjens
robjens / 01improved.fs
Last active August 29, 2015 14:22
Xmlstarlet iStandaarden XSD scrape
[<StructuredFormatDisplay("{Output}")>]
type Record(number:int, header:string, fields:array<int*int*string>) =
// internal helpers (fn and tuple unpack)
let runningTotal = List.scan (+) 0 >> List.tail
let fstUnpack (l,n,s) = l
let sndPackin a b = (a, b)
// sprintf format
let frm = "{0} - {1} ({2} slots)"