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
http://github.com/undefined
# This gist is a small example of how to use gephi from Jython
# IT IS INCOMPLETE - see below
#
# this is a small include offering only a minimal subset of shortcuts
# for a couple of Gephi Toolkit controllers. use it at your own risks.
#
# usage:
#
# 1. save this file to gephi.py
# 2. download the gephi toolkit and put it in your java classpath
@jbilcke
jbilcke / regex to convert static GEXF to dynamic one
Created February 1, 2011 17:58
edit this regex to suit your GEXF
REPLACE
label="(.*)">
<attvalues>
<attvalue for="classification" value="(.*)"></attvalue>
<attvalue for="embassy" value="(.*)"></attvalue>
<attvalue for="start" value="(.*)"></attvalue>
BY
@jbilcke
jbilcke / heroku-node.js
Created June 27, 2011 10:20
Node.JS inside Heroku
jbilcke@compactminer:~/Checkouts/git/daizoru/test$ git push heroku master
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (10/10), 984 bytes, done.
Total 10 (delta 0), reused 0 (delta 0)
-----> Heroku receiving push
-----> Node.js app detected
-----> Vendoring node 0.4.7
@jbilcke
jbilcke / MonbodbServlet.scala
Created June 28, 2011 09:07 — forked from ReSTARTR/MonbodbServlet.scala
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)
@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 / antialiased_webgl_circle
Created October 19, 2011 08:59
Anti-aliased circle in GLSL (eg. WebGL)
void main(void) {
vec2 pos = mod(gl_FragCoord.xy, vec2(50.0)) - vec2(25.0);
gl_FragColor = mix(vec4(.90, .90, .90, 1.0), vec4(.20, .20, .40, 1.0), smoothstep(380.25, 420.25, dot(pos, pos)));
}
@jbilcke
jbilcke / wtfisthisdiff
Created November 2, 2011 18:35
wtf is this diff?
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
=======
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
=======
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
@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. *
# * *