View ffmpeg-av-seq.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -f image2 -i render-%04d.png -i audio.mp3 -r 25 -vcodec libx264 -b:v 1024k -b:a 192k -t 00:00:04 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=10:10 [out]" out.mp4 |
View quil-agents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns resonate-2013.agents | |
(:use quil.core)) | |
(def num-agents 50) | |
(def num-targets 10) | |
;;; atom to hold global app state | |
(def app-state (atom {})) | |
;;; cheapskate vector ops |
View problem59.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns toxi.euler.problem59) | |
;; http://projecteuler.net/problem=59 | |
;; solution by: toxi <k at postspectacular dot com> | |
;; 2012-12-23 | |
(defn xor-decrypt | |
"Applies bit-xor to all items in src using key as cyclic sequence." | |
[src key] (map bit-xor src (cycle key))) |
View 1-project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject profiletest "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.5.1"]] | |
:main profiletest.core | |
:profiles { | |
:dev {:source-paths ["src" "src.dev"]} | |
:prod {:source-paths ["src" "src.prod"]} |
View tetrahedron-intersect.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Tetrahedron intersection based on this paper & algorithm: | |
;; http://vcg.isti.cnr.it/Publications/2003/GPR03/fast_tetrahedron_tetrahedron_overlap_algorithm.pdf | |
;; | |
;; Unlike original algorithm this implementation produces correct | |
;; results regardless of the orientation/ordering of points defining | |
;; the two tetrahedra. This is achieved via the orient-tetra function, | |
;; which ensures the correct ordering of vertices for this algorithm | |
;; to function properly. | |
;; | |
;; Implementation extracted from upcoming geometry library |
View deftype-apply.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftype Foo [x y] | |
clojure.lang.IFn | |
(invoke [_ a] (case a 0 x, 1 y)) | |
(invoke [_ a nf] (case a 0 x, 1 y nf))) | |
(def f (Foo. 23 42)) | |
(f 0) ; => 23 | |
(f 2 -1) ; => -1 | |
(apply f [0]) ; AbstractMethodError clojure.core/apply (core.clj:624) |
View pointatdemo.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pointatdemo | |
(:require | |
[thi.ng.geom.core :as g] | |
[thi.ng.geom.tetrahedron :as t] | |
[thi.ng.geom.meshio :as mio] | |
[clojure.java.io :as io])) | |
(defn point-at | |
"Takes an entity implementing PTransform, a reference point and two | |
direction vectors. Transforms the entity in such a way that the 1st |
View gist:10312313
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04 | |
sudo openssl genrsa -des3 -out new.key 1024 | |
sudo openssl req -new -key new.key -out new.csr | |
sudo cp new.key new.key.orig | |
sudo openssl rsa -in new.key.orig -out new.key | |
sudo openssl x509 -req -days 1095 -in new.csr -signkey new.key -out new.crt | |
sudo service nginx restart |
View retune-dnb.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live coding example for Retune conference 2014 | |
# 1) Press Run (Cmd+R) to start | |
# 2) Make changes (e.g. comment in/out various lines in :beats & :amen) | |
# 3) Press Run again (changes will only be audible from next queue point) | |
# compute loop length (4 bars), bar & quarter note durations | |
dur = sample_duration :loop_compus | |
bar = dur / 4 | |
quart = dur / 16 |
View gpg.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; add lein dep: | |
;; [org.bouncycastle/bcpg-jdk15on "1.51"] | |
;; export gpg public & private keys to armored files: | |
;; gpg -ao pub.asc --export XXXXXXXX | |
;; gpg -ao pk.asc --export-secret-keys XXXXXXXX | |
;; usage: | |
;; (encrypt "foo.txt" "foo.gpg" (pub-key "pub.asc")) | |
;; (decrypt "foo.gpg" (io/output-stream "foo.txt") (secret-key "ks-pk.asc") "passphrase") |
OlderNewer