Skip to content

Instantly share code, notes, and snippets.

View libbkmz's full-sized avatar

Ilya libbkmz

View GitHub Profile
import requests as req
import concurrent.futures as cf
import string
import random
WORKERS = 32
random_str = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(128))
def worker():
while True:
cimport cython
# USE cmdline below to build extension
# python setup.py build_ext --inplace --force
import numpy as np
cimport numpy as cnp
from libc.stdlib cimport rand, srand, RAND_MAX
cdef extern from "<Windows.h>":
#include <stdlib.h> // for rand() and RAND_MAX
int randint(int min, int max) {
return (rand() % (max + 1 - min)) + min;
}
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2016-2018 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
die() {
echo "[-] Error: $1" >&2
exit 1
}
@libbkmz
libbkmz / clink_inputrc_base
Created February 19, 2019 12:25
cmder configs
%%cython -a -f -c=-O3
# -c=-DCYTHON_TRACE=1
# -c=-std=c++11
# -c=-DCYTHON_TRACE=1
# -c=-DCYTHON_TRACE=1 -c=-g --link-args=-g
# %%cython -a -c=-DCYTHON_TRACE=1
# -c=-O3
# -c=-g --link-args=-g
# --cplus
#-c=-march=native -c=-mtune=native
quantile_list_big = [(1. - 0.1 ** x) + (0.1 ** (x + 1)) * y for x in xrange(1, 8+1) for y in xrange(1, 10)]
quantile_list_small = [(1. - 0.1 ** x) for x in xrange(1, 8+1)]
@libbkmz
libbkmz / CustomSurfView.java
Last active May 27, 2018 19:56
SurfaceView lockCanvas is very slow
package com.example.bkmz.surface_view_test;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class CustomSurfView extends SurfaceView implements SurfaceHolder.Callback {
@libbkmz
libbkmz / .inputrc
Last active July 27, 2018 15:28
Enable neat and tidy bash history usage
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
# -*- coding: utf-8 -*-
"""
Demonstrates very basic use of ImageItem to display image data inside a ViewBox.
"""
## Add path to library (just for examples; you do not need this)
# import initExample
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np