Skip to content

Instantly share code, notes, and snippets.

View labe-me's full-sized avatar

Laurent Bédubourg labe-me

View GitHub Profile
@labe-me
labe-me / Makefile.osx
Created September 3, 2011 10:31
openFrameworks Makefile for osx
# openFrameworks OS X makefile
#
# make help : shows this message
# make Debug: makes the application with debug symbols
# make Release: makes the app with optimizations
# make: the same as make Release
# make CleanDebug: cleans the Debug target
# make CleanRelease: cleans the Release target
# make clean: cleans everything
#
@labe-me
labe-me / gist:7066351
Last active December 26, 2015 00:39
Testing promhx and PromiseM.dO haxe -lib promhx -lib monax -lib nodejs -main T -js test.js
import promhx.*;
import js.Node;
class User {
public var id : Int;
public var name : String;
public function new(id, name){
this.id = id;
this.name = name;
@labe-me
labe-me / build.sbt
Created January 13, 2016 22:55
Enabling DCEVM and Hotswap Agent in SBT + sbt-revolver plugin
val hotswapAgentJarPath = Def.settingKey[Option[String]]("Path to hotswap-agent.jar, enables DCEVM in run and reStart")
// set hotswapAgentJarPath := Some("/Users/lbedubourg/local/hotswap-agent.jar")
hotswapAgentJarPath := sys.env.get("HOTSWAP_AGENT_JAR")
def hotswapJavaOptions(path: Option[String]) = path match {
case None => Seq()
case Some(p) => Seq("-XXaltjvm=dcevm", s"-javaagent:${p}=autoHotswap=true")
}
@labe-me
labe-me / OrientationTracker.scala
Created November 13, 2016 22:53
Getting android device orientation relatively to north
package android
import android.app.Activity
import android.content.Context
import android.hardware._
/** Listen to device Orientation changes.
*
* Note: if you use libgdx your the work is already done in Gdx.input.getRotationMatrix() and Gdx.input.getPitch()
*/
@labe-me
labe-me / example.scala
Created March 24, 2017 17:21
Akka http prometheus request latency and count instrumentation.
val requestCount = io.prometheus.client.Counter.build().name("http_requests").help("HTTP requests").register()
val requestLatency = io.prometheus.client.Histogram.build().name("http_latency").help("HTTP requests latency").labelNames("code").register()
/*
Example usage:
trackPrometheusMetrics {
complete("OK")
}
*/