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
@jbilcke
jbilcke / create_video.py
Last active July 25, 2023 07:14
How to create a video using Gephi + Scripting plugin + ffmpeg
execfile("/your/path/to/videomaker.py")
videomaker(
ts_min=1352261778000, # "from" timestamp..
ts_max=1352262378000, # .."to" timestamp
frames=20, # number of images in the video. eg 200 frames for a video at 20 frames per seconds = 10 seconds of video
output_prefix="/path/to/output/dir/frame_", # path where to write the png. images will be prefixed with "frame_"
output_format=".png" # you probably want to leave png here
)
@jbilcke
jbilcke / d3-radial-tree-bug
Created November 15, 2012 09:33
fix for the d3.js radial tree bug (when there is only 1 child on the root)
importScripts('../vendor/d3/d3.layout.redux.js')
@onmessage = (msg) ->
tree = msg.data
# the layout has a weird effect
if tree.children.length is 1
for n in tree.children[0].children
tree.children.push ghost: yes, children: []
@jbilcke
jbilcke / swag.coffee
Created October 14, 2012 13:28
chain coffeescript functions like this -> "a b c d e" (yep, no parenthesis or ->)
#!/usr/bin/env coffee
###########
# old way #
###########
# functions
a = (x) -> (g) -> g x * x
b = (x) -> (g) -> g x + x
c = (x) -> (g) -> g x * 100
# wait / don't wait
wait = (t=0) -> (f) -> setTimeout f, t
async = (f) -> setTimeout f, 0
# simple shortcut
log = console.log
class Main
compute: (a,b) -> a*b + a*b
@jbilcke
jbilcke / common-coffee
Created December 8, 2011 17:26
common-coffee
# with common-node
httpclient = require "httpclient"
exports.app = ->
status: 200
headers: {}
body: new httpclient.HttpClient(url: "http://google.com").finish().body
# without
http = require "http"
http.createServer((req, res) ->
@jbilcke
jbilcke / libxmljs_node0.6
Created November 12, 2011 15:28
LibXMLjs for Node.JS 0.6.x
npm install https://github.com/shtylman/libxmljs/tarball/master
@jbilcke
jbilcke / wat
Created November 9, 2011 16:39
I SMELL A BUG THERE
switch (obj) {
case 'y' : tween = new TWEEN.Tween(camera.position).to({x:camera.position.x-to}, 2000).delay(0).easing(TWEEN.Easing.Circular.EaseOut).onUpdate( function() {}).start(); break;
case 'x' : tween = new TWEEN.Tween(camera.position).to({z:camera.position.z-to}, 2000).delay(0).easing(TWEEN.Easing.Circular.EaseOut).onUpdate( function() {}).start(); break;
}
@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. *
# * *
@jbilcke
jbilcke / wtfisthisdiff
Created November 2, 2011 18:35
wtf is this diff?
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
=======
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
=======
>>>>>>> 75e9c553ff4894231f0b5df4b25b489e43556583
@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)));
}