# 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Node.js server", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access", | |
"Type" : "String" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c. UMongo 1.2.1 | |
In the server text field, change 'localhost' to '127.0.0.1' and it should work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.idea/ | |
/project/boot/ | |
/project/plugins/project | |
target/ | |
lib_managed/ | |
src_managed/ | |
test-output/ | |
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |