Skip to content

Instantly share code, notes, and snippets.


Jaroslaw Zabiello hipertracker

View GitHub Profile
from workalendar.europe import Ireland
def irish_bank_holidays(year: int) -> list:
calc = Ireland()
return [x[0] for x in calc.holidays(year)]
hipertracker / PageSearchInput.vue
Created Jun 17, 2020
Dynamic URL change: Quasar/Overmind + TypeScript + vue-router
View PageSearchInput.vue
<q-input clearable filled type="text" :value="q" @input="updateQuery" />
<script lang="ts">
import { defineComponent, ref, onMounted } from '@vue/composition-api';
export default defineComponent({
name: 'PageSearchInput',
hipertracker / DynamicQuery.vue
Last active Jun 15, 2020
Dynamic URL change: Quasar + TypeScript + vue-router
View DynamicQuery.vue
<q-page padding>
<q-input filled type="text" :value="query" @input="updateQuery" />
<script lang="ts">
hipertracker / main.go
Last active Feb 27, 2020
Golang: sorting a slice of string with Polish sorting rules
View main.go
package main
import (
type text []string
hipertracker /
Last active Feb 1, 2020
Words tokenizer
import glob
import re
from typing import Iterator, List, Set, Tuple
from yaml import BaseLoader, load
def extract_words(text: str, min_length: int = 2) -> Set:
regex_words = re.compile(r"[\W]+", re.U)
return set(
hipertracker /
Created Jan 12, 2020
Missing list flatten function in Python
def flatten(items: list, result: list = None) -> list:
if result is None:
result = []
for item in items:
if isinstance(item, list):
flatten(item, result)
return result
from django.test import TestCase
from portal.lib.verses_parser import extract_verses, refs_with_chapter, split_refs
class VersesParserTestCase(TestCase):
maxDiff = None
def test_split_refs(self):
given = split_refs("Gen 1:2; 3:4-5", ["bw"])
hipertracker / zsh-and-oh-my-zsh.txt
Created Dec 18, 2019
zsh + oh-my-zsh simple install
View zsh-and-oh-my-zsh.txt
1. Install zsh from packages
2. Install oh-my-zsh:
sh -c "$(curl -fsSL"
git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
3. configure ~/.zshrc
hipertracker / react-custom-element.js
Created Dec 11, 2019
React refs forwarding to custom element issue
View react-custom-element.js
import * as React from 'react'
import {Component} from 'react'
class App extends Component {
setSvgRef(ref) {
console.log('Parrent React got ref:', ref); // this works
render() {
return <ScatterPlot svgRef={e => this.setSvgRef(e)}/>
hipertracker / setStateSynchronous.js
Created Nov 14, 2019
React synchronous setState
View setStateSynchronous.js
setStateSynchronous(stateUpdate) {
return new Promise(resolve => {
this.setState(stateUpdate, () => resolve());