Skip to content

Instantly share code, notes, and snippets.

View joshvera's full-sized avatar
🔥
intros nightingale.

Josh Vera joshvera

🔥
intros nightingale.
View GitHub Profile
{-# LANGUAGE GADTs, RankNTypes #-}
import Prelude hiding (read, print)
-- The "operational" form
data Action a where
Print :: String -> Action ()
Read :: Action String
{-
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@noahlz
noahlz / clojure-nyc-meetup-notes-20120718.md
Created July 20, 2012 17:28
Rough Notes from the July 18 Clojure NYC Meetup

Organizing Clojure Projects

Presented by @stuartsierra

Stuart presented using a deck created with org-html-slideshow, a Clojure library for formatting org-mode notes as HTML slides.

General Code Structure / Organization
  1. Be careful not to make function calls across component boundaries.
  2. Protocols should be minimalistic. They should have the fundamental operations of your component.
@jboner
jboner / latency.txt
Last active May 19, 2024 16:30
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@evanbeard
evanbeard / registrations_controller.rb
Created May 11, 2012 19:53 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@jspahrsummers
jspahrsummers / gist:2268658
Last active October 2, 2015 15:28
AppKit classes not supporting weak references (on 10.7)
# In a class-dump of AppKit:
$ ack -l '\)(retain|release);' . | awk -F '.' '{ print $1 }'
__NSATSStringSegment
__NSFontTypefaceInfo
__NSSharedFontInstanceInfo
_NSCachedAttributedString
_NSStateMarker
NSATSGlyphStorage
NSATSTypesetter
@stuarthalloway
stuarthalloway / gist:1980351
Created March 5, 2012 18:56
frinj unit conversion running inside a Datomic datalog query
;; lein settings
(defproject foo "1.0.0-SNAPSHOT"
:description "Test App"
:dependencies [[com.datomic/datomic "0.1.2678"]
[frinj "0.1.2" :exclusions [org.clojure/clojure]]])
;; load libs
(use 'frinj.core 'frinj.calc)
(frinj-init!)
(use '[datomic.api :only (q db) :as d])
@alexdreher
alexdreher / rcov.rake
Created November 10, 2010 00:24 — forked from zhengjia/gist:395021
rcov raketask for Rails 3, RSpec 2
# Forked to get it working with Rails 3 and RSpec 2
#
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
#
# Use rcov:rspec or rcov:cucumber
# to get non-aggregated coverage reports for rspec or cucumber separately
@kevinold
kevinold / git-flow_test.sh
Created August 19, 2010 16:45
testing git-flow on existing git repo
# In reply to my own question
# (http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/#comment-69995567)
# about using git-flow with existing git repos I experimented with a dummy
# git repo and it appears rather straight-forward
kold@Macintosh-27 $ git init test_git_flow
Initialized empty Git repository in /private/tmp/test_git_flow/.git/
(/tmp)
kold@Macintosh-27 $ cd test_git_flow/