Skip to content

Instantly share code, notes, and snippets.

@keyan
keyan / lmdb.tcl
Created February 27, 2019 07:19 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@keyan
keyan / task1.exs
Created October 30, 2017 19:06 — forked from moklett/task1.exs
Elixir Task - Crash Handling
# This demonstrates that, when using async/await, a crash in the task will crash the caller
defmodule Tasker do
def good(message) do
IO.puts message
end
def bad(message) do
IO.puts message
raise "I'm BAD!"
end
@keyan
keyan / super-tip.txt
Created March 4, 2017 23:28 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation - Vim tip
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
@keyan
keyan / System Design.md
Created April 18, 2016 03:05 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Interview Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

@keyan
keyan / timelapse.zsh
Last active August 29, 2015 14:15 — forked from jamak/timelapse.zsh
#! /bin/zsh
TIME=$1
FNAME=$2
# if [[ $# != 3]] then;
# echo "USAGE: $0 time_interval filename"
# exit 2
# fi
if [[ -f $FNAME ]]; then