Skip to content

Instantly share code, notes, and snippets.

View joshrotenberg's full-sized avatar
💀

josh rotenberg joshrotenberg

💀
View GitHub Profile
// 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 {
{-# OPTIONS -Wall #-}
module Main where
import Control.Concurrent (threadDelay)
import System.Environment (getArgs)
import System.INotify
main :: IO ()
main = do

This is my recommended path for learning Haskell.

Something to keep in mind: don't sweat the stuff you don't understand immediately. Just keep moving.

Primary course

Installing Haskell

Ubuntu PPA

(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))
@joshrotenberg
joshrotenberg / gist:6274576fb605279ada93
Last active August 29, 2015 14:13
Quick attempt to take a nice Clojure map and convert it to a format that will play nice with Java Properties. Inspired by similar clojure.walk functions.
(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)."
@joshrotenberg
joshrotenberg / config.exs
Created June 25, 2015 20:53
kafka_ex producer error
use Mix.Config
config KafkaEx,
brokers: [{"localhost", 9092}]
input {
file {
path => "/tmp/doof/*"
codec => "gzip_lines"
start_position => "beginning"
}
}
output {
kafka {
var sys = require('sys'),
times = 500000
function bm(label, fn) {
var start = +new Date
fn()
sys.puts(' ' + label + ' : ' + (+new Date - start) + ' ms')
};
#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>
@joshrotenberg
joshrotenberg / nest-nav.html
Created October 12, 2011 22:21
trying to get a nested slideshow with cycle to allow navigation of the subslides within the sub slides themselves.
<!DOCTYPE html>
<html>
<head>
<title>JQuery Cycle Plugin - Nested Slideshows</title>
<style>
body { margin: 40px }
#controls { width: 200px; height: 55px }
#slideshow,#controls { margin: auto; overflow: hidden; }
#inner { overflow: hidden; }
#prev, #prev-inner { float: left; }