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
@mardambey
mardambey / AkkaKafkaMailboxTest.scala
Last active August 3, 2019 05:03
Akka 2.0 actors with Kafka 0.7.x backed durable mailboxes.
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.agent.Agent
import com.typesafe.config.ConfigFactory
import akka.event.Logging
import akka.actor.Props
import kafka.utils.Utils
import java.nio.ByteBuffer
@jhurliman
jhurliman / audioExtractor.js
Created March 1, 2012 23:09
Read PCM (WAV) data with node.js
var spawn = require('child_process').spawn;
exports.getPcmData = function(filename, sampleCallback, endCallback) {
var outputStr = '';
var oddByte = null;
var channel = 0;
var gotData = false;
// Extract signed 16-bit little endian PCM data with ffmpeg and pipe to STDOUT
var ffmpeg = spawn('ffmpeg', ['-i',filename,'-f','s16le','-ac','2',
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@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
@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. *
# * *
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
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 WTF YOU WANT TO PUBLIC LICENSE
@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 / 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 / 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.
"""
@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