Skip to content

Instantly share code, notes, and snippets.

View robjens's full-sized avatar

Rob J robjens

  • Netherlands
View GitHub Profile
@robjens
robjens / dependencies.asciidoc
Last active August 29, 2015 14:22
Clojure notes

Clojure Dependency Hell

Clojure and Java + Maven form a great powerhouse in anyone’s stack. How to spot and resolve conflicting software is something that puzzled me for a bit. There are a few techniques to employ:

Steps

The main 'go-to-guy' is lein deps :tree in the /path/to/project/root (read: where the project.clj file is). This will compile a dependency tree which lists conflicting software e.g.

@robjens
robjens / 01.md
Last active August 29, 2015 14:22
ZM IO31 XPATH

For any scraping istandaarden.nl in Windows, this'll come in handy:

http://stackoverflow.com/a/12524960

This because JDK (slurp, or enlive or otherwise) chokes on the cert, it needs to be added following those steps (worked for me).

# select all container elements mandatory presence
@robjens
robjens / abstract.asciidoc
Last active August 29, 2015 14:22
LightTable Additions

Light Table IDE CodeMirror Additional Modes

Simply place the text as .js file named like that in either the C:\Program Files\LightTable\core\node_modules\codemirror\modes folder or Linux/Mac equivalent folder. Restart Light Table, it should work automatically but may not at first. Ensure the file saved has the proper extension (or set one up on user behaviors) and persist to disk. Close the file, then reopen it. It should have the syntax highlight of that language.

@robjens
robjens / 01.asciidoc
Last active August 29, 2015 14:23
Basic math and general knowledge of underlying concepts in computer science, algebra etc. focus on the *why* but also how for laymen like myself.

Math

Operator Precedence

Or formally titled Order of operations on wikipedia, it covers the topic that, in mathematics and most computer languages, multiplication is done before addition.

Example implicit operator precedence
2 + 3 × 4
@robjens
robjens / 00.fs
Last active February 26, 2019 22:59
XSD to type generation - rewritten in and for F# from C# example
(* Well at least it works now *)
module Types
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Reflection
open System.Resources
@robjens
robjens / build.boot
Last active August 29, 2015 14:25
Light Table + Hoplon + Boot + Cljs + Cljsbuild ;; Requires copy/paste of port to LT Remote nREPL connection
#!/usr/bin/env boot
#tailrecursion.boot.core/version "2.5.1"
(set-env!
:project 'petproject
:version "0.1.0-SNAPSHOT"
:dependencies '[[tailrecursion/boot.task "2.2.4"]
[tailrecursion/hoplon "5.10.25"]]
:out-path "resources/public"
@robjens
robjens / 01.litcoffee
Last active August 29, 2015 14:25
Functional CoffeeScript
@robjens
robjens / js2cs.zsh
Last active August 29, 2015 14:25
Small executable scripts
#!/usr/bin/env zsh
# New file location of CS generated
cs=${PWD}/${1:r:t}.coffee
# Resolve absolute path and also symbolic links on positional parameter 1 then
# pipe to the current directory and create a file with the same name but
# different extension. Drops a coffee file in Present Working Directory.
js2coffee -i 4 ${1:A} > $cs
@robjens
robjens / wisp.coffee
Last active November 5, 2015 11:35
Language extension for wisp in the nesh Node.js REPL
###
Wisp homoiconic Clojure-like to JavaScript transpiler
language component for Nesh, the Node.js enhanced shell.
###
require 'colors'
wisp = require 'wisp'
compiler = require 'wisp/compiler'
log = require '../log'
@robjens
robjens / date.abnf
Created September 8, 2015 19:06
A few BNF files I co(rr|ll)ected for Instaparse
; http://www.ietf.org/rfc/rfc3339.txt
; and http://www.odata.org/documentation/odata-version-3-0/abnf/
oneToNine = "01" / "02" / "03" / "04" / "05" / "06" / "07" / "08" / "09"
zeroToNine = "00" / oneToNine
oneToTwelve = oneToNine / "1" ( "0" / "1" / "2" )
oneToThirteen = oneToTwelve / "13"