So, how do i...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go 1.6.1, Some combinations are valid, some not | |
// The known operating systems. | |
var okgoos = []string{ | |
"darwin", | |
"dragonfly", | |
"linux", | |
"android", | |
"solaris", | |
"freebsd", | |
"nacl", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
# Without cache: | |
# User time (seconds): 29.46 | |
# Maximum resident set size (kbytes): 9724 | |
# With cache: | |
# User time (seconds): 2.34 | |
# Maximum resident set size (kbytes): 297288 | |
# CacheInfo(hits=999998, misses=2168611, maxsize=None, currsize=2168611) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from timeit import timeit | |
setup_chunks_iter = ''' | |
def chunks_iter(n, seq): | |
"""Chunks from iterable""" | |
for i in range(0, len(seq), n): | |
yield seq[i:i + n] | |
''' | |
setup_chunks_gen = ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ITERS=8000 | |
FILE="mandelbrot.py" | |
PY_3_5_PATH="python3.5" | |
PY_3_6_PATH="python3.6" | |
PYPY_3_PATH="/opt/pypy/pypy3-v5.5.0-linux64/bin/pypy3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import pyscreenshot as ImageGrab | |
import wx | |
def main(): | |
count = 10 | |
area = (0, 0, 1920, 1080) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
`fuck this shit`() | |
` `() | |
ľščťžýáél9() | |
} | |
fun `fuck this shit`() { | |
println("Hello from `fuck this shit`") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging.handlers | |
logger = logging.getLogger("loggers") | |
class CustomFormatter(logging.Formatter): | |
def format(self, record): | |
return f"{record.levelname} | {record.filename}:{record.levelno}:{record.lineno} | {record.msg}" | |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm