Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am initbar on github.
  • I am initbar (https://keybase.io/initbar) on keybase.
  • I have a public key whose fingerprint is 3D60 027E A59C 2D90 4A5C CFDC 4C4A 2990 B573 20ED

To claim this, I am signing this object:

@initbar
initbar / memtest.py
Last active November 23, 2017 02:48
#!/usr/bin/env python
from __future__ import print_function
from prettytable import PrettyTable
MEMORY_UPPER_LIMIT = float(16 * 2<<39)
a = -2
b = a + 1
#!/usr/bin/env python
from bashplotlib.histogram import plot_hist
import random
import sys
if __name__ == '__main__':
print
import os
import signal
PID = os.getpid()
def main():
k='%s'%'abs'
a=eval(k)
b=abs
print("%s"%hex(id(a)))
print("%s"%hex(id(b)))
try: assert a==b
#!/usr/bin/env python
from bashplotlib.histogram import plot_hist
from bashplotlib.scatterplot import plot_scatter
from os import urandom
import os
import time
if __name__ == '__main__':
# MIT License
#
# Copyright (c) 2019 Herbert Shin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
from PIL import Image
import pprint
import random
import numpy
class RandomPixelsDist(object):
def __init__(self, width=10, height=10, density=0.8):
self.width = width
# https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function
import base64
import struct
def fnv64(data):
hash_ = 0xcbf29ce484222325
for b in data:
hash_ *= 0x100000001b3
hash_ &= 0xffffffffffffffff
@initbar
initbar / Dockerfile
Created August 14, 2020 13:06
Dummer
FROM ubuntu:18.04
USER root
WORKDIR /root
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
gcc \
import turtle
def fib():
i, j = 0, 1
yield i
while True:
i, j = j, i + j
yield i