Skip to content

Instantly share code, notes, and snippets.

View okeyokoro's full-sized avatar

Daniel Okey-Okoro okeyokoro

View GitHub Profile
#!/bin/env python
# -------------------------------------------------------------------------------
# This is a basic implementation of comments with a flat structure,
# as described in my article:
# https://blog.miguelgrinberg.com/post/implementing-user-comments-with-sqlalchemy
# -------------------------------------------------------------------------------
from datetime import datetime
from flask import Flask
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active July 12, 2025 14:53
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

class conduit(object):
def __init__(self, iterator):
self.iterator = iterator
def filter(self, predicate):
return conduit(itertools.ifilter(predicate, self.iterator))
def map(self, func):
return conduit(itertools.imap(func, self.iterator))
@font-face {
font-family: 'Linux Libertine'; /* normal */
src: url('/static/fonts/linux-libertine/LinLibertine_R.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Linux Libertine'; /* italic */
src: url('/static/fonts/linux-libertine/LinLibertine_RI.woff') format('woff');
@alanwill
alanwill / api-gateway-mapping-template.json
Created April 3, 2016 06:34
AWS API Gateway Mapping Template
{
"body" : $input.json('$'),
"headers": {
#foreach($header in $input.params().header.keySet())
"$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end
#end
},
"method": "$context.httpMethod",
"params": {
@PhilipWitte
PhilipWitte / concepts.nim
Last active March 8, 2023 00:46
How to use concept in Nim
type
CanDance = concept x
dance(x) # `x` is anything that has a `dance` procedure
proc doBallet(dancer: CanDance) =
# `dancer` can be anything that `CanDance`
dance(dancer)
# ---
@vasanthk
vasanthk / System Design.md
Last active July 14, 2025 03:42
System Design Cheatsheet

System Design 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?
@alexsavio
alexsavio / mcmc
Last active February 25, 2025 00:16 — forked from osdf/gist:5133737
Simple MCMC sampling with Python
"""
Some python code for
Markov Chain Monte Carlo and Gibs sampling
by Bruce Walsh
"""
import numpy as np
import numpy.linalg as npla
@oubiwann
oubiwann / ring.lfe
Last active December 14, 2019 00:43
Ring Benchmark in Lisp Flavored Erlang
;; The code below was translated from the Erlang ring benchmark hosted
;; at http://benchmarksgame.alioth.debian.org, written by Jiri Isa and
;; optimized by Shun Shino:
;; http://goo.gl/5YOjg3
;;
;; The LFE version split the logic of the above-mentioned Erlang code
;; into more functions for increased clarity.
;;
(defmodule ring
(export