Skip to content

Instantly share code, notes, and snippets.

@PJUllrich
PJUllrich / big-o.md
Last active June 28, 2024 20:25
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@keathley
keathley / .credo.exs
Last active December 30, 2023 16:13
Keathley's credo file
# This file contains the configuration for Credo and you are probably reading
# this after creating it with `mix credo.gen.config`.
#
# If you find anything wrong or unclear in this file, please report an
# issue on GitHub: https://github.com/rrrene/credo/issues
#
%{
#
# You can have as many configs as you like in the `configs:` field.
configs: [
@Physes
Physes / TX.sol
Last active July 26, 2017 13:18
Ticker Exchange: a service for registering asset ticker symbols
pragma solidity ^0.4.11;
/**
* Ticker Exchange is a service for registering asset ticker symbols
* and pointing them to a particular resource, for example an ENS
* resolver or a token contract.
*
* Ticker hashes are hierarchical. erc20 token "BNT", which is contained
* within ETH, is found using pathhash("ETH:BNT", ":"). If BNT creates
* sub-token XYZ then those tickers can be registered with "ETH:BNT:XYZ".
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
balance = 1.0 # amount of reserve tokens
supply = 1000.0 # amount of smart tokens
crr = 0.001 # arbitrary reserve ratio
def printInfo():
price = computePrice()
print "balance", balance, "supply", supply, "price", price
def computePrice():
return balance / (supply * crr)
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
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!
@swlaschin
swlaschin / ndclondon17_fp_track.md
Last active July 10, 2017 11:04
Functional Track talks from NDC London 2017

Functional Track talks from NDC London 2017

Also, here is the list of all videos from NDC London 2017:

Wednesday 2017-01-18

@kozikow
kozikow / job_submit.py
Created January 31, 2017 08:17
Submiting job to kubernetes
import os
import re
import kubernetes
import logging
import math
from kubernetes.client import V1Container
from kubernetes.client import V1EnvVar
from kubernetes.client import V1Job
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active June 25, 2024 07:29
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would