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
@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
@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',
@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
ar http = require('http');
var fs = require('fs');
var util = require('util');
var fileCache;
var sendFile = function(conn, file) {
conn.writeHead(200, {"Content-Type": "text/html", "Content-Length": file.length});
conn.write(file);
conn.end();
}
@mavropalias
mavropalias / gist:3135341
Created July 18, 2012 09:55
Node.js Amazon Cloudformation template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Node.js server",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access",
"Type" : "String"
},
@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
@travisbrown
travisbrown / tower-of-hanoi.scala
Created September 23, 2012 17:44
Solving the Tower of Hanoi at the type level
/**
* Type-level Tower of Hanoi
* by Travis Brown
*
* Note: not optimal, and probably won't work for some valid inputs.
* Tested with Scala 2.9.2 and Shapeless 1.2.3.
*/
import shapeless._, Nat._
@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
// 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