Skip to content

Instantly share code, notes, and snippets.

View stoeckley's full-sized avatar

andrew stoeckley

  • Balcony Studio
  • Netherlands
View GitHub Profile
@sixman9
sixman9 / CMakeLists.txt
Created December 14, 2010 10:42
cmake files for Apple IOS development (has C++ lean, can be adapted however)
# See original post at http://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
cmake_policy(SET CMP0016 NEW)
project(test)
set(NAME test)
@daveray
daveray / seesaw-repl-tutorial.clj
Created December 7, 2011 04:55
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@syshen
syshen / gist:4516930
Created January 12, 2013 09:31
core image crop and resize
CIFilter *resizeFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"];
[resizeFilter setValue:ciImage forKey:@"inputImage"];
[resizeFilter setValue:[NSNumber numberWithFloat:1.0f] forKey:@"inputAspectRatio"];
[resizeFilter setValue:[NSNumber numberWithFloat:xRatio] forKey:@"inputScale"];
CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"];
CIVector *cropRect = [CIVector vectorWithX:rect.origin.x Y:rect.origin.y Z:rect.size.width W:rect.size.height];
[cropFilter setValue:resizeFilter.outputImage forKey:@"inputImage"];
[cropFilter setValue:cropRect forKey:@"inputRectangle"];
CIImage *croppedImage = cropFilter.outputImage;
@Engelberg
Engelberg / SantaClaus.clj
Created February 19, 2013 18:47
Santa Claus problem in Clojure
;; Ref-based Santa Claus solution, Written by Mark Engelberg
;; (start-simulation) to run
(def *num-elves* 10)
(def *num-reindeer* 9)
;; Santa is a ref containing either {:state :asleep} or {:state :busy, :busy-with <sequence-of-workers>}
(def santa (ref {:state :asleep}))
(defn waiting-room [capacity]
@songpp
songpp / ProtobufTest.hs
Last active July 21, 2016 13:05
zeromq and protobuf example by haskell
module ProtobufTest where
import System.ZMQ3
import Control.Monad
import Data.ByteString.UTF8 as U
import Control.Concurrent (threadDelay)
import NotificationMessageProtos.NotificationMessage as N
import NotificationMessageProtos.EncryptType
import Text.ProtocolBuffers.WireMessage (messageGet)
@saolsen
saolsen / draw-2d.cljs
Last active June 22, 2021 06:45
2d canvas drawing in clojurescript
(ns saolsen.draw-2d)
;; Draw stuff (and never care about ie ever)
;; There's obviously a ton this lib doesn't do, just adding what
;; I need when I need it.
(def request-animation-frame
(or js/requestAnimationFrame
js/webkitRequestAnimationFrame))
(defn get-canvas-context-from-id
@mbostock
mbostock / .block
Last active February 25, 2024 17:46
Closest Point on Path
license: gpl-3.0
@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)
@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)
@kanedo
kanedo / Makefile
Last active May 7, 2020 00:55
Makefile for Xcode C++ projects
#############################################################
# #
# Generic Makefile for C++ projects #
# Author: Gabriel <software@kanedo.net> #
# Date: 2014-04-18 #
# Version: 1.0 #
# #
#############################################################