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
@webknjaz
webknjaz / orange_hrm_filler.js
Last active August 27, 2018 09:36
This script helps to pre-populate empty days in Orange HRM time tracking solution (https://www.orangehrm.com/)
/* Usage:
* First, fill in any absenses and business trips
* After that open DevTools (normally F12), and then REPL (Esc), and copy-paste this there + hit Enter
* Script will only fill in empty lines, ignoring what you filled in already, so it won't be corrupted
*/
function fill_in_day(tbl_row) {
$(tbl_row.querySelector('td>input[id$="_inTime"]')).val('09:00')
$(tbl_row.querySelector('td>input[id$="_outTime"]')).val('18:00')
$(tbl_row.querySelector('td>input[id$="_breakDuration"]')).val('01:00')
$(tbl_row.querySelector('td>label[id$="_totalWork"]')).val('08:00')
@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

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:

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
@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
# All build snippets are based on Ubuntu trusty:
containers:
build:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
# ------------------------------------------------------------------------
@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)
@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
var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("TOKEN", data.tokenId);