This is my recommended path for learning Haskell.
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
// Package readyset provides a simple set implementation. | |
package readyset | |
import "fmt" | |
// Set is a container for arbitrary data which ensures that duplicates elements will not be stored multiple times. | |
type Set map[interface{}]struct{} | |
// NewSet creates a new Set containing the given elements. | |
func NewSet(in ...interface{}) Set { |
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
{-# OPTIONS -Wall #-} | |
module Main where | |
import Control.Concurrent (threadDelay) | |
import System.Environment (getArgs) | |
import System.INotify | |
main :: IO () | |
main = do |
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
(ns immutant.init | |
(:require [immutant.messaging :as msg] | |
[immutant.pipeline :as pl] | |
[clojure.tools.logging :as log])) | |
(defn add-two [m] | |
(log/info "add-two processing" m) | |
(+ 2 m)) |
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
(require '[clojure.walk :refer [postwalk]] | |
[clojure.string :as s]) | |
(defn keyword-to-property | |
"Replace :foo-bar with \"foo.bar\", etc." | |
[k] | |
(s/replace (name k) #"\-" ".")) | |
(defn propertyize-map | |
"Recursively transforms all map keys from keywords to Java property strings and values to strings (if necessary)." |
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
use Mix.Config | |
config KafkaEx, | |
brokers: [{"localhost", 9092}] |
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
input { | |
file { | |
path => "/tmp/doof/*" | |
codec => "gzip_lines" | |
start_position => "beginning" | |
} | |
} | |
output { | |
kafka { |
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 sys = require('sys'), | |
times = 500000 | |
function bm(label, fn) { | |
var start = +new Date | |
fn() | |
sys.puts(' ' + label + ' : ' + (+new Date - start) + ' ms') | |
}; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <time.h> | |
#include <stdbool.h> | |
#include <ev.h> | |
#include <evcom.h> |
OlderNewer