This file contains hidden or 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) |
This file contains hidden or 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 |
This file contains hidden or 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 |
This file contains hidden or 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
| convert -strip -interlace Plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -quality 90% src.jpg dest.jpg |
This file contains hidden or 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 coloredmesh | |
| (:require | |
| [thi.ng.geom.core :as g] | |
| [thi.ng.geom.core.vector :as v] | |
| [thi.ng.geom.core.matrix :as mat :refer [M44]] | |
| [thi.ng.geom.aabb :as a] | |
| [thi.ng.geom.core.utils :as gu] | |
| [thi.ng.geom.webgl.core :as gl] | |
| [thi.ng.geom.webgl.arrays :as arrays] | |
| [thi.ng.geom.webgl.animator :as anim] |
This file contains hidden or 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
| ;; CLJS 0.0-3196 | |
| (reduce conj [] (eduction (filter identity) [1 2 3 4])) | |
| ;; [1 2 3 4] | |
| (defrecord Foo [state]) | |
| (defn add-foo [foo x] (Foo. (conj (:state foo) x))) | |
| (reduce add-foo (Foo. []) (sequence (filter identity) [1 2 3 4])) | |
| ;; => #cljs.user.Foo{:state [1 2 3 4]} |
This file contains hidden or 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
| (require | |
| '[thi.ng.geom.core :as g] | |
| '[thi.ng.geom.core.vector :as v :refer [vec2 vec3]] | |
| '[thi.ng.geom.core.matrix :refer [M44]] | |
| '[thi.ng.geom.core.utils :as gu] | |
| '[thi.ng.geom.aabb :as a] | |
| '[thi.ng.geom.plane :as pl] | |
| '[thi.ng.geom.quad :as q] | |
| '[thi.ng.geom.webgl.core :as gl] | |
| '[thi.ng.geom.webgl.buffers :as buf] |
This file contains hidden or 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
| (require '[thi.ng.strf.core :as strf]) | |
| (require '[clojure.string :as str]) | |
| (defn parse-accept-header | |
| [accept] | |
| (->> accept | |
| (re-seq #"((([\w\*\-]+/[\w\*\-\+]+,?)+)(;q=(\d+\.\d+))?)") | |
| (mapcat | |
| (fn [[_ _ a _ _ q]] | |
| (let [q (if q (strf/parse-float q 0) 1)] |
This file contains hidden or 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
| .syntax unified | |
| .cpu cortex-m4 | |
| .thumb | |
| .thumb_func | |
| foo: | |
| ldr r0, =timer @ load address of label | |
| ldr r1, [r0, #4] @ load word following bar ( => SysTick_VAL => 8 ) | |
| ldr r0, [r0] @ deref label addr => SysTick_BASE | |
| ldr r0, [r0, r1] @ => val of [SysTick_BASE + SysTick_VAL] |
This file contains hidden or 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 |
OlderNewer