Skip to content

Instantly share code, notes, and snippets.

Avatar

Hunan Rostomyan hunan-rostomyan

View GitHub Profile
@aputs
aputs / pyenv_install_python
Created Dec 2, 2020
pyenv install python versions on big sur
View pyenv_install_python
export MACOSX_DEPLOYMENT_TARGET=11.0
brew install pyenv bzip2 zlib xz openssl@1.1
## 3.6.8
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.6.8 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
## 3.6.12
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.6.12 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
## 3.7.9
@tokestermw
tokestermw / machine_learned_index.py
Last active Apr 9, 2019
Using deep learning to approximate a B-Tree index from this paper: https://arxiv.org/abs/1712.01208 (The Case for Learned Index Structures)
View machine_learned_index.py
import click
import torch
import torch.autograd
import torch.nn.functional as F
from torch.autograd import Variable
import os
import random
import math
@groteck
groteck / Spelling.elm
Last active Feb 20, 2020 — forked from evancz/Spelling.elm
Remove unused import
View Spelling.elm
port module Spelling exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import String
main =
program
{ init = init
@danneu
danneu / Current.elm
Created Dec 7, 2015
Usage: `Current.date ()`
View Current.elm
module Current where
import Native.Current
import Time exposing (Time)
import Date exposing (Date)
-- milliseconds since epoch
time : () -> Time
time _ =
@evanscottgray
evanscottgray / docker_kill.sh
Last active Mar 26, 2021
kill all docker containers at once...
View docker_kill.sh
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@jboner
jboner / latency.txt
Last active Apr 10, 2021
Latency Numbers Every Programmer Should Know
View latency.txt
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