Skip to content

Instantly share code, notes, and snippets.

View shurph's full-sized avatar
🛠️
trying to bring something into the world

Mikalai Saskavets shurph

🛠️
trying to bring something into the world
View GitHub Profile
@shurph
shurph / ladder.md
Created May 7, 2021 12:45 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@shurph
shurph / grodno-5-meetup-splashscreen.mp4
Last active February 26, 2020 10:13
iTechMeetup Splash Screens

Keybase proof

I hereby claim:

  • I am shurph on github.
  • I am shurph (https://keybase.io/shurph) on keybase.
  • I have a public key ASACLTTAwwbblOrboARoHv2tcLR1AAcAq7Jm6zSIOZmFDQo

To claim this, I am signing this object:

@shurph
shurph / getAuthorsNamesFromTelegramChat.js
Created February 23, 2019 22:07
Get Authors Names From Telegram Chat via DevTools (Firefox or Chrome)
// in DevTools (Firefox or Chrome):
var all = document.querySelectorAll('.from_name');
var names = [];
for (var a in all) {
if (all.hasOwnProperty(a)) {
names.push(all[a].textContent.trim());
}
}
names.sort()
@shurph
shurph / fetch-all-repos.sh
Last active December 6, 2018 16:11
Fetch all repos which are situated inside the current directory in any nested level
#!/usr/bin/env sh
ROOT_DIR=`pwd`;
COLOR_BLUE="\e[34m"
COLOR_YELLOW="\e[33m"
COLOR_DEFAULT="\e[0m"
if [ 'pull' = "$1" ]; then
GIT_COMMAND='pull'
else
@shurph
shurph / filter_dict.py
Created August 7, 2018 16:31
how to filter keys in a dict
#!/usr/bin/env python
from operator import itemgetter
# v1
def filter_dict_1(dict_obj, allowed_fields):
getter = itemgetter(*allowed_fields)
return dict(zip(allowed_fields, getter(dict_obj)))
# v2
@shurph
shurph / convox_bash_completion
Last active January 24, 2017 20:08
Bash completion for Convox CLI
#!/bin/bash
#
# Bash completion for Convox CLI
# This snippet is based on @soulshake's code from https://github.com/convox/rack/issues/1405
# It also includes @wav's improvements from https://github.com/urfave/cli/issues/272#issuecomment-245862282
#
# INSTALLATION:
# (or see install.sh for copy&paste solution)
# `
# export BCC_SNIPPET=https://gist.github.com/sir-shurph/8b7b7c8cd6823627669ad623543a8306
@shurph
shurph / csv2json.py
Created July 20, 2016 09:33
Convert csv data (with a header line) to json (rough draft)
#!/usr/bin/env python3
"""
Convert csv data (with a header line) to json
rough draft
"""
h = csv[0]
d = csv[1:]
hh = dict(zip(range(len(h)), h))
json = [{hh[j]: k for j, k in zip(range(len(i)), i)} for i in d]
@shurph
shurph / watchdog.sh
Last active August 29, 2015 14:22
Следит за страничками сайта bsuir.by на предмет изменений
#!/usr/bin/env bash
STAMP=`date +%s`
URL_FKP="http://www.bsuir.by/online/showpage.jsp?PageID=93390&resID=100229&lang=ru&menuItemID=102722"
URL_FZO="http://www.bsuir.by/online/showpage.jsp?PageID=83907&resID=100229&lang=ru&menuItemID=113354"
MAIN_CONTENT_SELECTOR=".content_body .con > table > tr:nth-child(1) > td:nth-child(1)"
# todo: делать конвертацию HTML сущностей в юникод
# perl -MHTML::Entities -pe 'decode_entities($_);'