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 / 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 / graph.js
Created April 29, 2017 14:48
Vis.js graph component for Idyll
const React = require('react');
const IdyllComponent = require('idyll-component');
const Graph = require('react-graph-vis').default;
const options = {
layout: {
hierarchical: true
},
edges: {
color: "#000000"
Unicode = {
/* Strings to match Unicode characters in the BMP according to their Unicode category.
Extracted from Unicode specification, version 5.0.0, source:
http://unicode.org/versions/Unicode5.0.0/
*/
/*
Abbr Long Description
Lu Uppercase_Letter an uppercase letter
Ll Lowercase_Letter a lowercase letter
Lt Titlecase_Letter a digraphic character, with first part uppercase
'use strict'
import React, { Component, PropTypes } from 'react'
import { findDOMNode } from 'react-dom'
import c3 from 'c3'
import 'c3/c3.css'
const emptyFunc = () => {};
@jbilcke
jbilcke / array.js
Last active August 23, 2016 09:44
Array<Array>, Array<{}> or Array<Object>? tests made with node 6.3.0 on a mac
// Execution time: 1048
// { rss: 1028186112, heapTotal: 1015271424, heapUsed: 969132048 }
var start = new Date().getTime();
var arr = [];
for (i = 0; i < 10000000; ++i) {
arr.push([Math.random(), Math.random()])
}
@jbilcke
jbilcke / total.js
Created March 7, 2016 11:01
Calcul du total par personne
function total(opts){
var plats = opts.plats.reduce((r,p) => r + p)
return plats + (opts.livraison / opts.nbPersonnes) - (plats * opts.reduction)
}
total({
plats: [3.10, 8.20, 0.30], // prix des plats d'une personne
livraison: 1.50, // 12h-13h
reduction: 0.15, // 15%
@jbilcke
jbilcke / gist:6537280
Created September 12, 2013 13:26
"It is possible to stream a request directly to a Node.js Stream object by calling the createReadStream() method on a request. " http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/makingrequests.html
(new AWS.S3()).getObject(Bucket: 'myBucket', Key: 'myImageFile.jpg').createReadStream().pipe(require('fs').createWriteStream('/path/to/file.jpg'))
@jbilcke
jbilcke / run.sh
Created August 28, 2013 08:08
How to run Gephi from sources
#!/bin/bash
cd modules/application && mvn nbm:cluster-app nbm:run-platform
@jbilcke
jbilcke / after.coffee
Created July 31, 2013 22:10
wrapper for checking returned values in coffee
result = do (value=some(operation(42))) ->
throw Error "too low" if value < 0.5
value