Skip to content

Instantly share code, notes, and snippets.

@jstaffans
jstaffans / entso.md
Created February 7, 2017 12:28
ENTSO-e API notes

ENTSO-e REST API notes

  • Actual generation: 16.1.B&C, documentType=A75
  • ProcessType "realised": A16
  • 50Hz area: 10YDE-VE-------2

Examples

Actual generation 50Hz area, all power system resources (PSR:s), ie all types of power generation

@jstaffans
jstaffans / remote.sh
Created February 2, 2017 13:20
Execute contents of script via SSH
#!/bin/sh
tail -n +3 "@0" | ssh <foo@bar>; exit
echo "hi"
@jstaffans
jstaffans / reloading.txt
Created November 29, 2016 18:59
re-frame reloading
4:31 PM]
jstaffans what do I have to do to make the re-frame simple example preserve state when figwheel reloads? ie the content of the input gets reset to the default value when figwheel reloads currently. https://github.com/Day8/re-frame/tree/master/examples/simple)
[6:30 PM]
pesterhazy @jstaffans that should work actually
[6:32 PM]
what I'd do is to start debugging where reloading goes off the rails
[6:32 PM]
@jstaffans
jstaffans / dir-locals.el
Created November 1, 2016 17:06
Two REPLs
((nil . ((cider-lein-parameters . "do clean, repl :headless")
(cider-cljs-lein-repl . "(start) (repl)"))))
# if you put this into dir-locals.el of your project - whenever you run `cider-jack-in-clojurescript` it will run the second thing and you’d have 2 independent repl buffers - one for Clojure. another for Clojurescript
@jstaffans
jstaffans / learn-specter-content.md
Last active September 28, 2016 19:52
Functionality to include in learn-specter

redplanetlabs/specter#45

New stuff:

  • Precompilation feature enabling performance rivaling hand-optimized code
  • Facilities for creating recursive navigators, including pre-walk and post-walk traversals (declarepath/providepath, stay-then-continue, continue-then-stay)
  • ClojureScript support
  • Conditional navigation (if-path, cond-path)
  • Protocol paths: navigate based on the type of data encountered
@jstaffans
jstaffans / transducers.md
Last active February 3, 2016 08:59
Clojure's transducers

Transducers in Clojure

Some notes for myself.

  • Single-threaded concept, no inherent parallelism (as opposed to reducers)
  • Key benefits: function composition, better performance by way of removing need for creation of intermediary collections
  • Parallelism can be introduced by:
    • Using core.async pipelines + transducers
    • using r/fold (see comments here)
  • For heavy, parallel data crunching, reducers will still probably be faster
@jstaffans
jstaffans / core.clj
Last active January 8, 2016 12:11
Clojure and Java
(ns example-app.core)
(defn send-mails
[{:keys [weather-forecast]}]
;; ...
)
@jstaffans
jstaffans / profiles.clj
Created September 23, 2015 18:39
leiningen profile
{:user {:dependencies [[org.clojure/tools.namespace "0.2.11"]
[spyscope "0.1.5"]
[pjstadig/humane-test-output "0.7.0"]]
:injections [(require '[clojure.tools.namespace.repl :refer [refresh set-refresh-dirs]])
; try/catch to workaround an issue where `lein repl` outside a project dir
; will not load reader literal definitions correctly:
(try (require 'spyscope.core)
(catch RuntimeException e))
(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
@jstaffans
jstaffans / words.txt
Created September 23, 2015 18:24
Daily Programmer #227
billowy
biopsy
chinos
defaced
chintz
sponged
bijoux
abhors
fiddle
begins
@jstaffans
jstaffans / distributed_matters_2015.markdown
Last active May 9, 2016 02:37
distributed matters 2015

Notes from the distributed matters 2015 conference.

Jepsen V (Kyle Kingsbury)

Talks about how Jepsen works and what systems have been tested until now, among others:

  • Riak: default is last-write-wins, but you should not be using it
  • ZK: works as advertised (!)

... But all of this is also on his blog, not anything really new.