Skip to content

Instantly share code, notes, and snippets.

Sander Dijkhuis sander

View GitHub Profile
View agenda.json
{
"updated": "2018-05-13T10:54:07.829Z",
"events": [
{
"url": "https://pop-in-expo.hetnieuweinstituut.nl/activiteiten/gear",
"suptitle": "Tentoonstelling",
"title": "Gear Up",
"description": "Gear Up toont speculatieve ontwerpen vanuit een activistisch uitgangspunt. Alle werken zijn ontwikkeld door studenten van de opleiding Interaction Design tijdens een lesmodule Information Superiority gegeven door Arif Kornweitz.",
"start": "2018-04-10T09:00:00.000Z",
"end": "2018-05-13T15:00:00.000Z",
View keybase.md

Keybase proof

I hereby claim:

  • I am sander on github.
  • I am sq (https://keybase.io/sq) on keybase.
  • I have a public key ASD_8jMfWgcTbtdt0PbqfxsZdG_-ZnkuHGhIRIhwGtjqmwo

To claim this, I am signing this object:

@sander
sander / _error
Created Aug 17, 2016
Problem deploying ring-1.6.0-beta5 uberwar with async in jetty9
View _error
clojure.lang.ArityException: Wrong number of args (1) passed to: core/handler
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.AFn.invoke(AFn.java:32)
at clojure.lang.Var.invoke(Var.java:379)
at lein_ring_test.listener$_contextInitialized$fn__11.invoke(listener.clj:1)
at ring.util.servlet$make_service_method$fn__85.invoke(servlet.clj:129)
at lein_ring_test.servlet$_service.invokeStatic(servlet.clj:1)
at lein_ring_test.servlet$_service.invoke(servlet.clj:1)
at lein_ring_test.servlet.service(Unknown Source)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
@sander
sander / _log-curl
Last active Aug 8, 2016
ring 1.6.0-beta4 issue
View _log-curl
$ curl -vvv http://localhost:3000/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 08 Aug 2016 13:50:07 GMT
View EithersAndOptionals.cs
// Catch errors early
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace EithersAndOptionals
{
struct Either<T1, T2> where T1 : class where T2 : class
View errors.txt
Warning (emacs): Unable to activate package `with-editor'.
Required package `dash-2.11.0' is unavailable
Warning (emacs): Unable to activate package `solarized-theme'.
Required package `dash-2.6.0' is unavailable
Warning (emacs): Unable to activate package `magit-popup'.
Required package `dash-2.11.0' is unavailable
Warning (emacs): Unable to activate package `magit'.
Required package `dash-2.11.0' is unavailable
Warning (emacs): Unable to activate package `git-commit'.
Required package `dash-2.11.0' is unavailable
View compilation.clj
(println "loading deps")
(require
'[cljs.build.api :as build])
(defn release []
(build/build
"src"
{:main 'fmp.core
:output-to "release/release.js"
@sander
sander / dl.js
Created Dec 8, 2015
Download pins from a Pinboard board
View dl.js
var size = '474x'; // alts: 60x60, 236x, 736x, orig
var n = 0;
var result = $('.BoardPage .Pin').map(function (_, it) {
var url = $(it).find('.pinHolder > a').attr('href');
return {
desc: $(it).find('.pinDescription').text().trim(),
url: url,
id: +url.split('/')[2],
n: n++
};
View async-error.txt
/Users/sander/Code/fmp/out/cljs/core.cljs:261
(js/Error.
^
Error: No protocol method ReadPort.take! defined for type null:
at cljs$core$missing_protocol (/Users/sander/Code/fmp/out/cljs/core.cljs:261:4)
at cljs$core$async$impl$protocols$take_BANG_ (/Users/sander/Code/fmp/out/cljs/core/async/impl/protocols.js:27:34)
at cljs$core$async$impl$ioc_helpers$take_BANG_ (/Users/sander/Code/fmp/out/cljs/core/async/impl/ioc_helpers.js:103:68)
at /Users/sander/Code/fmp/out/cljs/core/async.js:783:52
at /Users/sander/Code/fmp/out/cljs/core/async.js:888:51
at cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$3.cljs.core.async.impl.dispatch.run.call.cljs$core$async$state_machine__18606__auto____1 (/Users/sander/Code/fmp/out/cljs/core/async.js:909:4)
View transducing.cljs
(defn- before [begin]
(fn [{:keys [time]}]
(<= time begin)))
(defn- weighted [weigh now ival]
(fn [{:keys [time] :as entry}]
(assoc entry :weight (weigh (- 1 (/ (- now time) ival))))))
(defn- pop-while [pred queue]
(loop [q queue]
(if (and (not (empty? q))
(pred (peek q)))
You can’t perform that action at this time.