Skip to content

Instantly share code, notes, and snippets.

View JakubTesarek's full-sized avatar
🏠
Working from home

Jakub Tesárek JakubTesarek

🏠
Working from home
View GitHub Profile
class SparseVector:
def __init__(self, values, indexes, length):
self.values = values
self.indexes = indexes
self.length = length
def items(self):
indexes = enumerate(self.indexes)
i, index = next(indexes, (-1, -1))
for j in range(self.length):
{
"basics": {
"name": "Jakub Tesárek",
"label": "Software Engineer",
"picture": "https://tesarek.me/media/profile.png",
"email": "jakub@tesarek.me",
"phone": "+420 721812945",
"website": "https://tesarek.me",
"summary": "I am software engineer with more than 9 years of experience. I learn fast and in my career I adopted many different technologies a programming languages - I started as a PHP web developer. Currently I'm designing and programming cloud applications in Python using AWS.",
"location": {
import aiohttp
import asyncio
url = 'https://httpbin.org/get'
class HttpClient:
def __init__(self):
self.session = aiohttp.ClientSession()
@JakubTesarek
JakubTesarek / vim_cheat.md
Last active August 12, 2018 17:57
Vim cheatsheet

Navigation

Command Description
h Left
j Down
k Up
l Right

Moves

| Command | Description |

import random
def roll2d6():
res = random.randint(1, 6) + random.randint(1, 6)
while res <= 2 and random.randint(1, 6) <= 3:
res -= 1
while res >= 12 and random.randint(1, 6) >= 4:
res += 1
return res
import re
summary = '[application-package-1.234] bug fixed'
res = re.match('\[(?P<pkg>(?P<pkg_name>[a-zA-Z\-]+)-(?P<pkg_ver>[0-9](\.[\.0-9]+)?))\] ?(?P<desc>.+)', summary)
print res.groupdict()
<style type="text/css">
#canvas {
/*background-color: red;*/
position: absolute;
top: 0;
left: 0;
cursor: pointer;
/*pointer-events: none;*/
}
</style>
@JakubTesarek
JakubTesarek / git_cheat.md
Created August 1, 2016 09:38
Git Cheatsheet

Configuration

Display configuration

git config --list

Set global name used for commiting

$ git config --global user.name "[name]"

Set global email used for commiting

$ git config --global user.email "[email address]"

@JakubTesarek
JakubTesarek / interview.php
Last active March 16, 2018 11:15
Interview question for PHP developers
<?php
/*
Objectives:
- Create PHP script that will translate input data to expected output from example below.
- Calculate time complexity of your script
bonus: Implement solution that will not use pass-by-reference and will not use objects
*/
$input = [
'A' => 1,
@JakubTesarek
JakubTesarek / .bashrc
Last active October 27, 2021 19:59
.bashrc file with useful shortcuts. The file can update itself using `updaterc`. Also contains detection of platform it's running on
# if not running interactively, don't do anything
[ -z "$PS1" ] && return
# Detect platform
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'FreeBSD' ]]; then
platform='freebsd'