Skip to content

Instantly share code, notes, and snippets.

💭
👨‍💻

Jiri Kuncar jirikuncar

💭
👨‍💻
Block or report user

Report or block jirikuncar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jirikuncar
jirikuncar / style.css
Created Oct 31, 2019
Number headers with CSS
View style.css
body {
counter-reset: h2counter;
}
h1 {
counter-reset: h2counter;
}
main h2:before {
content: counter(h2counter) ".\0000a0\0000a0";
View .bash_profile
#!/usr/bin/env bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Path to the bash it configuration
export BASH_IT="${HOME}/.bash_it"
@jirikuncar
jirikuncar / Dockerfile
Last active Mar 26, 2019
Traefik with ForwardAuth middleware
View Dockerfile
FROM python:3.7-alpine
RUN pip install flask
COPY app.py /code/app.py
WORKDIR /code
ENV FLASK_APP=app:app
CMD ["flask", "run", "-h", "0.0.0.0"]
View janus_schema.py
import collections
import datetime
import logging
from goblin import properties
logger = logging.getLogger(__name__)
CARD_MAPPING = {'Cardinality.single': 'Cardinality.SINGLE',
@jirikuncar
jirikuncar / README.md
Last active Aug 3, 2019
Traefik - header matching
View README.md

Traefik routing

Proxy to services based on Accept header.

Run

docker-compose up -d

Test

@jirikuncar
jirikuncar / .a README.md
Last active Mar 29, 2019
Remote Jupyter Kernel at CSCS
View .a README.md

Configuration

Direct Access to Computing Systems

  1. Get an Account and store your account name export CSCS_USER=unixname.
  2. Configure direct access to the computing system. You can use the ssh_config template:
    $ cat >> ~/.ssh/config <<EOF
    Host *
     AddKeysToAgent yes  # only for MacOS
    
@jirikuncar
jirikuncar / README.rst
Last active Sep 28, 2016
PyLint checker for number of calls inside try blocks.
View README.rst

Download try_calls.py and install pylint

$ pip install pylint

Run pylint with an additional plugin on a bad.py file

$ pylint --load-plugins=try_calls bad.py

In case you try_calls.py is not recognized add it to PYTHONPATH.

@jirikuncar
jirikuncar / github-number-of-commits-since-last-tag.py
Created Aug 22, 2016
GitHub: number of commits since last tag
View github-number-of-commits-since-last-tag.py
import sys
from getpass import getpass
import github3
def main(_, username, name='inveniosoftware'):
gh = github3.login(username, password=getpass())
org = gh.organization(name)
for repo in org.repositories():
tags = list(repo.tags(1))
View shot'em'll.py
# Add your Python code here. E.g.
import math
import random
from microbit import *
enemies = [[1, 0, 0.05]]
shots = []
game = True
killed = 0
@jirikuncar
jirikuncar / osx-setup.sh
Created Jun 23, 2016 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
View osx-setup.sh
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
You can’t perform that action at this time.