Skip to content

Instantly share code, notes, and snippets.

View aherok's full-sized avatar

Andrzej Herok aherok

View GitHub Profile
@aherok
aherok / Dockerfile
Last active May 9, 2020 12:46
Puppetteer screenshooter PoC
# https://github.com/buildkite/docker-puppeteer/blob/master/Dockerfile
FROM node:12.16.3-slim
RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
# Install Chrome to get all the dependencies just to keep deps up to date
@aherok
aherok / app.py
Created March 4, 2020 11:26
Starlette + Ariadne handling sessions test
"""
Required to install:
* starlette
* ariadne
* uvicorn
run via `uvicorn app:app`
"""
import logging
from dataclasses import dataclass

Keybase proof

I hereby claim:

  • I am aherok on github.
  • I am aherok (https://keybase.io/aherok) on keybase.
  • I have a public key ASBf6QXuVb8_a2Kvb-0hmJGYpeYANErWsGKuDJjuqu3Vlgo

To claim this, I am signing this object:

@aherok
aherok / .bash_profile
Created April 18, 2017 19:47
git prompt in bash
#
# PROMPT + GIT INFO
#return value visualisation
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \[\033[00m\]\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@aherok
aherok / packages.json
Created March 28, 2017 12:05
stylelint
{
"devDependencies": {
"stylelint": "^7.9.0",
"stylelint-config-standard": "^16.0.0"
},
}
@aherok
aherok / .eslintrc.js
Last active April 4, 2017 18:36
eslint codestyle config
module.exports = {
// enable parsing ES5 code
/*
"parserOptions": {
"ecmaVersion": 5,
},
*/
"parser": "babel-eslint", // needed to properly parse ES7 features, e.g. 'static' declarations
Verifying that +aherok is my blockchain ID. https://onename.com/aherok
@aherok
aherok / fcpxml.py
Created March 25, 2015 21:02
Very robust .fpcxml -> .srt file converter
import os
from sys import argv
from xml.etree.ElementTree import parse
from pysrt import SubRipFile, SubRipItem, SubRipTime
def _mili_to_frame(secs):
"""
Convert "miliseconds" to frame count, e.g. if start time is 2.5s,
then its 2 secs and 12 frames, so function will return 2.12. Magic :)
@aherok
aherok / pg_locks.sql
Created April 11, 2014 13:01
display locking queries in pqsql. experimental.
SELECT
bl.transactionid,
bl.mode,
ka.query,
ka.query_start,
ka.state_change,
ka.state,
ka.pid
FROM pg_locks bl
@aherok
aherok / busy-indicator.js
Created January 15, 2014 13:36
AngularJS module that displays "please wait" message on time-taking actions. First attempt, yet working.
/**
* Indicator module - fades HTML content and displays "please wait" message on time-taking actions
* usage:
*
* html:
* <div busy-indicator="main-progress">
*
* js:
* busyIndicator.add("main-progress");
* // do some time-taking actions...