Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "glamor"
Option "DRI" "3"
EndSection
pydbg ()
{
local PYCHARM_HOST=${PYCHARM_HOST:-127.0.0.1};
local PYCHARM_PORT=${PYCHARM_PORT:-6000};
local extra;
[ "$1" == "--module" ] && {
shift;
extra="$extra --module"
};
[ "$1" == "--suspend" ] && {
var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("TOKEN", data.tokenId);
@webknjaz
webknjaz / script.py
Last active October 13, 2016 09:35
POSIX return code processing example
#! /usr/bin/env python
import sys
def main():
arg = sys.argv[1]
if smth_went_wrong(arg):
return 1 # failure code
return 0 # POSIX success
@webknjaz
webknjaz / mark_substrings.js
Last active July 2, 2017 16:34
Insert start/stop markers into a string
#! /usr/bin/env node
'use strict'
let inp_str = 'Hello, world!'
let inp_markers = [ [6, 10], [0, 2] ]
String.from_iterator = (str_iter) => ''.concat(...str_iter)
# All build snippets are based on Ubuntu trusty:
containers:
build:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
# ------------------------------------------------------------------------
@webknjaz
webknjaz / bash.generate.random.alphanumeric.string.sh
Created November 10, 2017 10:05 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@webknjaz
webknjaz / python-build.20180115145538.1345.log
Last active January 16, 2018 10:09
Failure of pyenv to install Python under macOS in Circle CI (https://github.com/pyenv/pyenv/issues/1066#issuecomment-357808697)
This file has been truncated, but you can view the full file.
/var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/python-build.20180115145538.1345 ~/project
/var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/python-build.20180115145538.1345/Python-3.6.4 /var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/python-build.20180115145538.1345 ~/project
checking build system type... x86_64-apple-darwin16.7.0
checking host system type... x86_64-apple-darwin16.7.0
checking for python3.6... no
checking for python3... no
checking for python... python
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... darwin

Keybase proof

I hereby claim:

  • I am webknjaz on github.
  • I am webknjaz (https://keybase.io/webknjaz) on keybase.
  • I have a public key ASDg1N6EExyydxaczF7g9-LhO0vsSIkH5PYU-uCo6n0I9go

To claim this, I am signing this object:

@webknjaz
webknjaz / README.md
Created April 19, 2018 15:07 — forked from crccheck/README.md
Python Packaging

What the Hell? -- A Journey Through the Nine Circles of Python Packing

Writing a setup.py

map

I am no Virgil, but having stumbled my way through Python packaging a few times already, I'm documenting the things I learn as I go here.

To help me learn, I took a survey of the top 15 Python packages on Github along with 12 other commonly referenced packages. I thought... if there are any best