Skip to content

Instantly share code, notes, and snippets.

View stekycz's full-sized avatar

Martin Štekl stekycz

  • DNAnexus, Inc.
  • Prague, Czech Republic
  • X @stekycz
View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

let refreshPromise = null;
const refreshAccessToken = () => {
if (refreshPromise != null) {
return refreshPromise;
}
refreshPromise = sendRefreshTokenRequest();
refreshPromise.then((response) => {
if (response.code !== 200) {
const refreshAccessToken = async () => {
const response = await sendRefreshTokenRequest();
if (response.code !== 200) {
return false;
}
updateAccessToken(response);
return true;
};
@stekycz
stekycz / cleanup-git-repositories.sh
Created February 28, 2017 10:40
Runs GC and prune in all GIT repositories in given path except PHP composer vendor directories and node_modules
#!/bin/bash
root=$1
current_dir=`pwd`
for file in `find $root -not -path "*vendor*" -not -path "*node_modules*" -name ".git"`; do cd $file/..; echo `pwd`:; echo; git gc; git prune; git gc; echo; done
cd $current_dir
{
"data": {
"id": "85bc026c-677a-4d0a-904f-251c9ed76973",
"state": "new",
"address": "...",
"items": [ ... ]
},
"events": {
"accepted": "https://api.my-eshop.example.com/order/85bc026c-677a-4d0a-904f-251c9ed76973/notifications?status=accepted",
"exported": "https://api.my-eshop.example.com/order/85bc026c-677a-4d0a-904f-251c9ed76973/notifications?status=exported",
{
"id": "85bc026c-677a-4d0a-904f-251c9ed76973",
"state": "new",
"address": "...",
"items": [ ... ]
}
@stekycz
stekycz / .bash_profile
Last active August 29, 2015 14:15
All git projects in folder garbage collection
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
# Changed these colors to fit Solarized theme
MAGENTA=$(tput setaf 125)
ORANGE=$(tput setaf 166)
GREEN=$(tput setaf 64)
PURPLE=$(tput setaf 61)
WHITE=$(tput setaf 244)
else
@stekycz
stekycz / zadani.md
Last active January 3, 2016 15:19
Zadání diplomové práce | Master thesis requirements

Testování RESTful API v rámci continuous integration

Nastudujte základy testování, různé metody, úrovně a typy testování, procesy související s testováním software a popište silné a slabé stránky jednotlivých metod, úrovní a typů testů. Vyhledejte a porovnejte různé nástroje zaměřující se na testování RESTful API v rámci continuous integration a nebo na popis RESTful API. Na základě těchto poznatků popište rozdíly a podobnosti metod testování samotného kódu u běžného SW a metod testování RESTful API.

Nastudujte syntaxi API Blueprint pro popis RESTful API a testovací nástroj Dredd. Porovnejte současné možnosti testování pomocí těchto nástrojů s dříve popsanými metodami a následně navrhněte možné změny a úpravy pro rozšíření možností těchto nástrojů.

Z navržených změn vyberte některé a ty implementujte. Implementované změny nabídněte v rámci Pull Requestu na serveru GitHub pro začlenění do hlavních repo

@stekycz
stekycz / TrollRandomNumberGenerator.php
Created November 26, 2013 16:28
Trolling random number generator
<?php
class TrollRandomNumberGenerator
{
/**
* @var int
*/
private $seed;
@stekycz
stekycz / php-arrays.php
Last active December 27, 2015 09:19
Simple benchmark of PHP build-in functions for arrays and general foreach.
<?php
ini_set('memory_limit', '4G');
$last_time = microtime(TRUE);
function timer() {
global $last_time;
$previous = $last_time;
$last_time = microtime(TRUE);
return $last_time - $previous;