Skip to content

Instantly share code, notes, and snippets.

View stoeckley's full-sized avatar

andrew stoeckley

  • Balcony Studio
  • Netherlands
View GitHub Profile
@nvbn
nvbn / core.cljs
Created June 28, 2015 14:54
vr with cljs
(ns vr-cljs.core)
(enable-console-print!)
(defn get-camera
"Creates camera with desired aspect ratio."
[]
(doto (js/THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window)
(.-innerHeight js/window))
0.1 1000)
@ducky427
ducky427 / core.cljs
Created June 11, 2015 11:31
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
@creichert
creichert / HsProtobufEx.hs
Last active July 21, 2016 13:04
Google Protobuf Example in Haskell
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DataKinds #-}
import Data.Int
import Data.ProtocolBuffers
import Data.Text
import GHC.Generics (Generic)
import GHC.TypeLits
import Data.Serialize
import Data.Monoid
@Integralist
Integralist / 0. description.md
Last active June 17, 2023 21:49
Clojure deftype, defrecord, defprotocol
  • defprotocol: defines an interface
  • deftype: create a bare-bones object which implements a protocol
  • defrecord: creates an immutable persistent map which implements a protocol

Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.

Note: defprotocol allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,

@akiatoji
akiatoji / Clojure_on_RaspberryPi_OSX.md
Last active December 3, 2022 21:15
Running Clojure on Raspberry Pi with OS X

Clojure on Raspberry Pi with OS X

"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.

Install JDK

  • Download ARM JDK from Oracle and instlal on Raspberry Pi
  • Change visudo to contain the following
@BennettSmith
BennettSmith / .gitignore
Last active July 2, 2024 06:49
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master
@kanedo
kanedo / Makefile
Last active May 7, 2020 00:55
Makefile for Xcode C++ projects
#############################################################
# #
# Generic Makefile for C++ projects #
# Author: Gabriel <[email protected]> #
# Date: 2014-04-18 #
# Version: 1.0 #
# #
#############################################################
@himerzi
himerzi / Game of Life
Created March 20, 2014 17:06
The Game of Life in Clojure, and rendered in Quil
(ns game-of-life.core
(:require [quil.core :as q])
(:use overtone.at-at))
(defn game-func
"function taking a game state to the following game state"
[state]
nil)
@seabre
seabre / three.cljs
Last active September 13, 2021 06:19 — forked from michiakig/three.cljs
Three.js demo with ClojureScript. Actually works.
(ns three.demo)
(def THREE js/THREE)
(def camera (THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window)
(.-innerHeight js/window)) 1 10000))
(set! (.-z (.-position camera)) 1000)
(def scene (THREE.Scene.))
(def geometry (THREE.CubeGeometry. 200 200 200))
(def obj (js/Object.))
(set! (.-color obj) 0xff0000)
(set! (.-wireframe obj) true)
@mbostock
mbostock / .block
Last active January 7, 2025 23:40
Closest Point on Path
license: gpl-3.0