Skip to content

Instantly share code, notes, and snippets.

View tavisrudd's full-sized avatar

Tavis Rudd tavisrudd

View GitHub Profile
@debasishg
debasishg / cache-oblivious.md
Last active September 2, 2024 07:20
Papers related to cache oblivious data structures

Cache Oblivious and Cache Aware Data Structure and Algorithms

  1. Cache-Oblivious Algorithms and Data Structures - Erik Demaine (One of the earliest papers in cache oblivious data structures and algorithms that introduces the cache oblivious model in detail and examines static and dynamic cache oblivious data structures built between 2000-2003)

  2. Cache Oblivious B-Trees - Bender, Demaine, Farch-Colton (This paper presents two dynamic search trees attaining near-optimal performance on any hierarchical memory. One of the fundamental papers in the field where both search trees discussed match the optimal search bound of Θ(1+log (B+1)N) memory transfers)

  3. Cache Oblivious Search Trees via Binary Trees of Small Height - Brodal, Fagerberg, Jacob (The data structure discussed in this paper works on the version of [2] but avoids the use o

@vladox
vladox / download_sentry_data.py
Last active April 13, 2024 01:00 — forked from bubenkoff/download_sentry_data.py
Download all sentry events for a project. Useful for data processing
"""Download sentry data.
usage:
python download_sentry_data.py <org>/<project> <api_key>
"""
import requests
import csv
import sys
if __name__ == '__main__':
@ketsuban
ketsuban / terminfo.md
Last active September 13, 2024 15:38

zsh users are advised to use the terminfo database as the most portable way to assign commands to particular keychords, but I haven't been able to find a database of which terminfo sigils correspond to which keys. Fortunately, I found enough information written in ancient Sumerian that I could translate it into something modern humans can comprehend.

Key Chord Terminfo Name
Backspace kbs
Ctrl-Backspace cub1
Insert kich1
Shift-Insert kIC
Alt-Insert kIC3
Shift-Alt-Insert kIC4
@roman
roman / CircuitBreaker.hs
Last active August 29, 2015 14:23
Prototype of CircuitBreaker interface using Type Families to compile valid transations of a CircuitBreaker state
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
import Data.Time (UTCTime, getCurrentTime)
data CircuitData = CircuitData {}

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@roman
roman / Example.hs
Last active August 29, 2015 14:03
Example of an "Actor-Like" Reactive Extension management in Haskell
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Rx.Actor
( GenericEvent, EventBus
, ActorBuilder, ActorM, ActorDef, Actor, RestartDirective(..), InitResult(..)
, SupervisorBuilder, SupervisorStrategy, SupervisorDef, Supervisor
-- ^ * Actor Builder API
, defActor, actorKey, preStart, postStop, preRestart, postRestart
, onError, desc, receive
@ChristopherBiscardi
ChristopherBiscardi / Data.Haxl.Postgres.DataStoreExample.hs
Created July 5, 2014 01:44
A naive Haxl example Postgres DataStore
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Data.Haxl.Postgres.DataStoreExample
@gelisam
gelisam / Main.hs
Last active August 22, 2022 18:18
IndexedMonad example
-- in reply to http://www.reddit.com/r/haskell/comments/21mja6/make_lllegal_state_transitions_unrepresentable/
--
-- We implement a tiny language with three commands: Open, Close, and Get.
-- The first Get after an Open returns 1, the second Get returns 2, and so on.
--
-- Get is only valid while the state is open, and
-- Open must always be matched by a Close.
-- We enforce both restrictions via the type system.
--
-- There are two valid states: Opened and Closed.
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@thezerobit
thezerobit / prolog peano
Created January 5, 2014 20:54
Peano relation in Prolog using the CLP(FD) that ships with SWI-Prolog.
:- use_module(library(clpfd)).
peano(N,z) :- N #= 0.
peano(N,s(PDec)) :-
N #> 0,
N - 1 #= NDec,
peano(NDec, PDec).
% ?- peano(4, Q).
% Q = s(s(s(s(z)))) ;