Skip to content

Instantly share code, notes, and snippets.

View joshrotenberg's full-sized avatar
💀

josh rotenberg joshrotenberg

💀
View GitHub Profile

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here: https://groups.google.com/forum/#!forum/crunchbase-api

CrunchBase API v1 Documentation

Overview

The CrunchBase API provides JSON representations of the data found on CrunchBase. The API currently supports three actions: "show", "search", and "list", which are each described below.

(ns ufold.core)
(use 'lamina.core 'aleph.tcp 'gloss.core)
(require 'gloss.io)
(use 'protobuf)
(defprotobuf Msg Ufold$Msg)
(defn dump-bytes [bytes]
(prn (seq bytes)))
@joshrotenberg
joshrotenberg / gist:1499232
Created December 19, 2011 22:36
style of client/worker request
;; i have this working on the client/send side using a multimethod
;; currently, sending looks like this
(let [reply (mdc/send! reverse-client "reverse3" "bleh")]
;; or like this
(let [reply (mdc/send! reverse-client "reverse3" '("bleh" "foo" "bar"))]
;; or
(let [reply (mdc/send! reverse-client "reverse3" ["bleh" "foo" "bar"])]
@joshrotenberg
joshrotenberg / gist:1541682
Created December 30, 2011 22:00
clojure ascii printable character stuff
(defn printable-char?
[c]
(if (and (> (int c) 32)
(< (int c) 127))
(char c)))
(def request (ordered-map
:req (string :utf-8 :length 4)
:type request-type
:size data-size
:data (string :utf-8)))
@joshrotenberg
joshrotenberg / cassandra-node-token.clj
Created January 27, 2012 19:57
clojure function to generate cassandra node tokens for a cluster
(use 'clojure.contrib.math)
(defn cassandra-token [number-nodes]
(dotimes [n number-nodes]
(println (format "token: %d %d" n (* n (quot (expt 2 127) number-nodes))))))
package main
// simple example to show how to process one message at a time with nsq using the go-nsq client library.
// see config stuff in var below to play around with different scenarios.
import (
"log"
"os"
"os/signal"
"strconv"
@joshrotenberg
joshrotenberg / fizzbuzz.erl
Created April 6, 2012 19:12
playing around with fizzbuzz in erlang
-module(fizzbuzz).
-export([start/0, start2/0]).
start() ->
fizzbuzz(1).
start2() ->
fizzbuzz2(1).
@joshrotenberg
joshrotenberg / fizzbuzz.clj
Created May 4, 2012 21:57
fizzbuzz in clojure
(defn fizzbuzz
[]
(doseq [i (range 0 100)]
(cond
(and (= 0 (mod i 3)) (= 0 (mod i 5))) (prn "FizzBuzz")
(= 0 (mod i 3)) (prn "Fizz")
(= 0 (mod i 5)) (prn "Buzz")
:else (prn i))))
defmodule Math.GCD do
@moduledoc "Functions for finding the Greatest Common Denominator"
@doc "Given two numbers, find their GCD"
def gcd(a, b) do
gcd b, rem a, b
end
@doc "Given a list of numbers, find their GCD."
def gcd(l) do