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 / externalmonitor
Created May 17, 2018 11:25 — forked from Gen2ly/externalmonitor
Toggle between laptop and external monitor
#!/bin/bash
# Toggle between laptop and external monitor
# Required program(s)
req_progs=(bc)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done

Visa requirements for UK conferences.

First you'll want to check if you need a visa to enter the UK.

  • Nationals of the EU, Switzerland, and EEA countries will not need a visa, and are free to work and conduct business in the UK.
  • Nationals from some designated countries such as USA may travel for tourist or business purposes under a visa exemption. The link above will detail what documents you need to provide in order to travel under a visa exemption.
  • Other nationals will need a visa.

The rules for allowable business travel under a visa exemption are covered by the same rules as those travelling under a vistor visa. If you will be travelling under a visa-exemption and the conference is covering your costs in any way you should make sure to read the relevant section below.

@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

@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 / branch-fu.md
Created August 26, 2016 09:47 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@webknjaz
webknjaz / 01-deferred-list.py
Created May 1, 2016 16:03 — forked from oubiwann/01-deferred-list.py
Async Batching with Twisted: A Walkthrough
from twisted.internet import defer, reactor
from twisted.web.client import getPage
def listCallback(results):
print results
def finish(ign):
reactor.stop()
def test():
@webknjaz
webknjaz / gist:4e9ef4a82cc41f1d8927b4018d7b8c3c
Created May 1, 2016 16:03 — forked from cefn/gist:7bb3dc5fbc61e03c9457
Example of trying to use Twisted's trial as an asynchronous unit test framework with paho-mqtt in python
#!/usr/bin/python
from __future__ import print_function
from threading import Thread
from twisted.internet.defer import Deferred
from twisted.trial.unittest import TestCase
from paho.mqtt.client import Client
@webknjaz
webknjaz / Exclude_tables.md
Created February 21, 2016 19:12 — forked from utek/Exclude_tables.md
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

def exclude_tables_from_config(config_):
    tables_ = config_.get("tables", None)

if tables_ is not None:

@webknjaz
webknjaz / gmail.py
Created December 12, 2015 12:02 — forked from miraculixx/gmail.py
Scrapy spider for Gmail API, using Django AllAuth as the token source
# -*- coding: utf-8 -*-
import base64
from items import EmailItem, EmailLabelItem
from loader import JSONItemLoader
from oauth2spider import OAuth2Spider
class GmailSpider(OAuth2Spider):
name = "gmail"