Skip to content

Instantly share code, notes, and snippets.

View jbilcke's full-sized avatar
🦫
building something

Julian Bilcke jbilcke

🦫
building something
View GitHub Profile
// We define a logical rule Augmentable that transform Int -> Long and Float -> Double
// at the type level with a dependent type.
// Then we want to abstract over arity and ensure that an "augment" transformation
// is defined for every type of a HList.
import shapeless._
// Dependent type T -> S (S depends on T)
trait Augmentable[T] {
type S
@ReSTARTR
ReSTARTR / MonbodbServlet.scala
Created May 28, 2011 10:13
Access from Scala to MongoDB on DotCloud.
package main.scala
import javax.servlet.http.{HttpServlet,HttpServletRequest,HttpServletResponse}
import org.eclipse.jetty.server.Server
import java.io.PrintWriter
import java.net.URLEncoder
class MongoServlet extends HttpServlet {
import com.mongodb.casbah.Imports._
val conn = MongoConnection("mongo.example.dotcloud.com",5907)
@aemkei
aemkei / LICENSE.txt
Created August 5, 2011 10:24 — forked from 140bytes/LICENSE.txt
rotate3D - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jbilcke
jbilcke / codegen.py
Created September 19, 2011 14:15 — forked from mattbasta/codegen.py
A module to "unparse" a Python AST tree.
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
@jbilcke
jbilcke / THREE.JS Image Loader using YQL
Created October 6, 2011 10:51
Download a texture using JQuery and YQL - please have a look at it before copypasting it inside your code (remember, YQL has quotas (1000queries/h for anonymous queries), and I'm not a Three.JS expert so I'm not sure about memory leaks, too)
// Use this function like the standard THREE.ImageUtils.loadTexture
THREE.ImageUtils.loadTextureWithYQL = function ( path, mapping, callback ) {
var image = new Image(), texture = new THREE.Texture( image, mapping );
var me = this;
image.onload = function () { };
image.crossOrigin = '';
image.src = path;
@jbilcke
jbilcke / push.coffee
Created November 7, 2011 15:56
Push.coffee
#/*****************************************************************************
# * *
# * PushScript *
# * Copyright (C) 2008-2010 Jonathan Klein *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
@kagemusha
kagemusha / gist:3215681
Created July 31, 2012 09:57
UMongo "com.mongodb.MongoException: can't find a master" when try to connect
c. UMongo 1.2.1
In the server text field, change 'localhost' to '127.0.0.1' and it should work
@helena
helena / akka-cluster-config
Created November 3, 2012 17:39
Here are some of the more interesting configurable cluster properties
# Here are some of the more interesting configurable cluster properties
# that enable you to maintain health of your system
# Note: The provider to use
akka.actor.provider = akka.cluster.ClusterActorRefProvider
akka.cluster {
# if after this duration no heartbeat has been received, you have a problem
failure-detector.acceptable-heartbeat-pause = 5s
@jrudolph
jrudolph / .gitignore
Created November 15, 2012 09:31
json-lenses example
/.idea/
/project/boot/
/project/plugins/project
target/
lib_managed/
src_managed/
test-output/
*.iml
@aral
aral / coffeetojson.sh
Created November 13, 2011 16:14
CoffeeScript to JSON script for OS X
coffee --print --compile $1.coffee | sed '1s/^.//' | sed 's/ });/}/' | sed "s/\([^ '\"].*[^ '\"]\):/\"\1\":/" > $1.json