Skip to content

Instantly share code, notes, and snippets.

View philippkueng's full-sized avatar

Philipp Küng philippkueng

View GitHub Profile
@adri
adri / Cypher Query Examples
Last active August 29, 2015 14:00
Cypher queries used for a demo presentation at liip
// ---------------------------------------------------------------
//// Loading data from CSV
// ---------------------------------------------------------------
CREATE CONSTRAINT ON (p:Person) ASSERT p.id IS UNIQUE;
CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE;
LOAD CSV WITH HEADERS FROM "file:///Users/adri/Downloads/neo4j-community-2.1.0-M01/employees.csv" AS l
CREATE (p:Person { id: toInt(l.employee_id), name: l.employee_firstname + " " + l.employee_lastname});
CREATE CONSTRAINT ON (t:Tech) ASSERT t.id IS UNIQUE;
;; ## Example of timeseries aggregation in cascalog.
;;
;; (copy paste all of this in at the REPL!)
(use 'cascalog.api)
(def tseries [["ndvi" 1 0 [1 2 3 4]]
["ndvi" 1 2 [2 3 4 5]]
["ndvi" 1 1 [4 3 2 1]]
["ndvi" 1 4 [1 2 3 4]]

We're doing a small year-end news nerd countdown on Source. Lists are too much, so please send us ONE THING—an app, a tool, an article, a tweet, an image, a map, or something else entirely—that you loved this year. Might be something that made your job easier or made you smarter, or it might have more obscure relevance. All we ask is that you can link to it.

Don't think too hard about it, just take 30 seconds and send one in now to source@mozillafoundation.org. We'll be posting an assembly of favorite things and all we can say about it right now is that there will be GIFs.

source@mozillafoundation.org

Wooo.

@arsatiki
arsatiki / Main.elm
Created January 23, 2014 06:54
Hack to load elm code into node.js. Requires path to Elm runtime file. Also included is an example file.
module Squarer where
import JavaScript as JS
foreign import jsevent "input"
(JS.fromInt 0)
inputs: Signal JS.JSNumber
foreign export jsevent "reply"
outputs: Signal JS.JSNumber
@mfikes
mfikes / shell.md
Created December 10, 2015 03:13
Using Planck shell support

Planck's shell support is modelled after clojure.java.shell. And, in particular, the command is separated from its arguments.

Here is an example sequence in a Clojure REPL illustrating this:

user=> (require 'clojure.java.shell)
nil
user=> (clojure.java.shell/sh "lein version")

IOException error=2, No such file or directory java.lang.UNIXProcess.forkAndExec (UNIXProcess.java:-2)
(define root 52)
(define scale (pc:scale 4 'aeolian))
(define right-hand
(lambda (beat dur)
(play sampler
(pc:quantize (cosr (+ root 24) (cosr 5 3 1/2) 7/3) scale)
(cosr 80 20 7/3)
(* 2.0 dur))
(if (> (random) .6)
@gzeureka
gzeureka / 00_notes.md
Created December 22, 2015 02:06 — forked from Deraen/00_notes.md
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
@chrisforrette
chrisforrette / circle.yml
Last active September 27, 2016 21:41
CircleCI Libsass Configuration
dependencies:
cache_directories:
- sassc
- libsass
post:
- if [[ ! -e sassc ]]; then git clone git@github.com:sass/sassc.git sassc; fi
- if [[ ! -e libsass ]]; then git clone --recursive git@github.com:sass/libsass.git && cd sassc && export SASS_LIBSASS_PATH=$(readlink -f ../libsass) && make && cd ..; fi
- ln -s sassc/bin/sassc ~/bin/sassc
@adstage-david
adstage-david / page_helpers.clj
Created September 9, 2016 21:09
Smoke Test Examples
(ns page-helpers
"All of the following page helpers take a \"page\", which is a map with
key names for named elements tied to their CSS selectors.
Page is expected to always have keys:
- :page-name (string)
- :page-id (css selector string)
- :page-url (regex to match url)
Using this as the first argument allows us to use the while-on and
within-modal macros to fill in the page in repeated series of steps (they both
@runexec
runexec / clojure-transduce-reduce.md
Last active August 16, 2017 22:11
Clojure's Transducers and Reducers

Transducers and Reducers

Notes and examples of Transducers and Reducers

Reducers

  • Used on collections

  • Eager evaluation only. (not lazy)