Skip to content

Instantly share code, notes, and snippets.

View Niedzwiedzw's full-sized avatar
🦀
providing safe API

Wojciech Niedźwiedź Niedzwiedzw

🦀
providing safe API
View GitHub Profile
@Niedzwiedzw
Niedzwiedzw / FillOverlay.vue
Created April 13, 2021 10:50
Vue 3 element overlay wrapper
<template>
<div class="FillOverlay" ref="element">
<slot class="overlay-content"></slot>
<div class="overlay" :style="currentOverlayStyle" :key="percent"></div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, computed, onMounted } from "vue";
import { useInterval } from "../../composables/forms";
(async() => {
const todos = [{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}, {
"userId": 1,
"id": 2,
"title": "quis ut nam facilis et officia qui",
(() => {
const data = [{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}, {
"userId": 1,
"id": 2,
"title": "quis ut nam facilis et officia qui",
@Niedzwiedzw
Niedzwiedzw / AppModal.vue
Created February 8, 2021 14:15
Vue 3 self-closing modal
<template>
<button class="activator" @click="onButtonClick()">
{{ buttonText }}
</button>
<transition name="slide-fade">
<div class="modal" :class="{ show }" :key="show" v-if="show">
<div class="exit-button" @click="onCloseModal()">
X
</div>
<div class="content">
@Niedzwiedzw
Niedzwiedzw / JsonSerializable mixin
Last active November 12, 2019 17:35
A quick way to have your class be serializable to json in a nested way
from json import dumps
from copy import deepcopy
class JsonSerializable:
@staticmethod
def _to_json(item):
if isinstance(item, JsonSerializable):
return item.json
#!/usr/bin/env python3
import typing as t
from os import listdir, environ, getcwd, mkdir
from os.path import split
from shutil import copyfile
from subprocess import check_output as run
from pprint import pprint
# works for Pycharm Professional Edition 2017.3 as of 26.03.2018
# send thanks to niedzwiedzwo@gmail.com
1. Ctrl + alt + S (settings)
2. find `External Tools`
3. fill them up like this: https://ibb.co/bEpth7
3a.
Program: {pylint_path} # just `pylint` should be ok for most cases