Skip to content

Instantly share code, notes, and snippets.

@arjan
arjan / gist:4054387
Created November 11, 2012 10:17
Starting espotify
ok = espotify_api:start(self(), "/tmp/espotify_nif", "/tmp/espotify_nif",
"user", "password"),
@arjan
arjan / worker.erl
Created December 14, 2012 09:09
Erlang shell script to do some work in parallel on a number of input files. Parallelism is limited by the NumWorkers variable.
#!/usr/bin/escript
%% -*- mode: erlang -*-
main(Files) ->
NumWorkers = 3,
Parent = self(),
Workers = [spawn_link(fun() -> worker(Parent) end) || _ <- lists:seq(1, NumWorkers)],
@arjan
arjan / gist:4318674
Created December 17, 2012 14:29
release notes 0.9.0

Release 0.9.0

Welcome Zotonic 0.9.0, released on December 17, 2012. These notes list the most important changes for this new feature release.

@arjan
arjan / not so short
Created December 17, 2012 14:35
zotonic 0.9 shortlog
Ahmed Al-Saadi (1):
* Removed websocket response header to conform to the latest proposed websocket protocol standard (see http://tools.ietf.org/html/rfc6455#section-4.2.2, December 2011)
Alain O'Dea (2):
* installmodule: Halt on failure to clone Fixes #404
* installmodule: Halt on failure to clone
Andreas Stenius (142):
@arjan
arjan / gist:4450884
Last active December 10, 2015 14:58
rebarizing zotonic
Make each module and each site an Erlang (library) app.
This means that each module should be structured like this:
├── dispatch
├── ebin
├── lib
│   ├── css
│   ├── images
├── src
│   ├── actions
Andreas Stenius (21):
* doc: renamed sidebar template to be more generic.
* doc: add links to other versions of the docs.
* doc: rename link to 0.9
* doc: fix version links.
* doc: removed a tag from the version being browsed.
* doc: update frontend-growl cookbook entry.
* zotonic-tpl-mode: fix for indenting consequtive closing template tags.
* zotonic-tpl-mode: bind C-M-\ to zotonic-tpl-indent-buffer.
@arjan
arjan / gist:5974897
Created July 11, 2013 12:08
Given 0-based column number return the Excel column name.
%% Given 0-based column number return the Excel column name as list.
column(N) ->
column(N, []).
column(N, Acc) when N < 26 ->
[(N)+$A | Acc];
column(N, Acc) ->
column(N div 26-1, [(N rem 26)+$A|Acc]).
@arjan
arjan / genvcl.py
Last active December 20, 2015 17:59
Generate varnish if-then-else statement for hosting multiple Zotonic versions
#!/usr/bin/env python
from glob import glob
import re
def backend(path):
return path.split('/')[3].replace('-', '_').replace('.', '_')
def site(path):
return path.split('/')[7]
package nu.reckon.app.tasks;
import nu.reckon.api.Client;
import nu.reckon.api.v5.Photo;
import nu.reckon.app.PhotoCache;
import nu.reckon.app.ReckonApi;
import nu.reckon.app.ui.ActivityIndicator;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

Keybase proof

I hereby claim:

  • I am arjan on github.
  • I am arjan (https://keybase.io/arjan) on keybase.
  • I have a public key whose fingerprint is 4952 8675 9F55 E55A E0AB 5B23 8A01 3801 B7E5 61EA

To claim this, I am signing this object: