Skip to content

Instantly share code, notes, and snippets.

View witoszekdev's full-sized avatar

Jonatan Witoszek witoszekdev

View GitHub Profile
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active July 31, 2025 20:51
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@witoszekdev
witoszekdev / pkd.json
Last active November 14, 2020 20:17
**POLSKA KLASYFIKACJA DZIAŁALNOŚCI 2007**, aktualne na 14.11.2020 (https://stat.gov.pl/Klasyfikacje/doc/pkd_07/pkd_07.htm)
{"01.11.Z": "Uprawa zbóż, roślin strączkowych i roślin oleistych na nasiona, z wyłączeniem ryżu", "01.12.Z": "Uprawa ryżu", "01.13.Z": "Uprawa warzyw, włączając melony oraz uprawa roślin korzeniowych i roślin bulwiastych", "01.14.Z": "Uprawa trzciny cukrowej", "01.15.Z": "Uprawa tytoniu", "01.16.Z": "Uprawa roślin włóknistych", "01.19.Z": "Pozostałe uprawy rolne inne niż wieloletnie", "01.21.Z": "Uprawa winogron", "01.22.Z": "Uprawa drzew i krzewów owocowych tropikalnych i podzwrotnikowych", "01.23.Z": "Uprawa drzew i krzewów owocowych cytrusowych", "01.24.Z": "Uprawa drzew i krzewów owocowych ziarnkowych i pestkowych", "01.25.Z": "Uprawa pozostałych drzew i krzewów owocowych oraz orzechów", "01.26.Z": "Uprawa drzew oleistych", "01.27.Z": "Uprawa roślin wykorzystywanych do produkcji napojów", "01.28.Z": "Uprawa roślin przyprawowych i aromatycznych oraz roślin wykorzystywanych do produkcji leków i wyrobów farmaceutycznych", "01.29.Z": "Uprawa pozostałych roślin wieloletnich", "01.30.Z": "Rozmnażanie roślin", "
@aleclarson
aleclarson / rollup-typescript.md
Last active September 14, 2025 14:31
The best Rollup config for TypeScript libraries

It's 2024. You should use tsup instead of this.


Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking

@eolant
eolant / Confirm.vue
Last active July 29, 2024 18:14
Vuetify Confirm Dialog component that can be used locally or globally
<template>
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
@LeCoupa
LeCoupa / 1_nanobox_cli.sh
Last active October 22, 2023 12:09
Nanobox Cheatsheet: CLI commands and Boxfile --> https://github.com/LeCoupa/awesome-cheatsheets
# *****************************************************************************
# UPDATED VERSION AVAILABLE HERE:
# https://github.com/LeCoupa/awesome-cheatsheets/blob/master/tools/nanobox_cli.sh
# *****************************************************************************
# *****************************************************************************
# LOCAL ENVIRONMENT
# *****************************************************************************
@nnja
nnja / config-editor.md
Created October 5, 2017 05:00
Configure git editor

Set which editor git should use.

This is the program that will open during a commit with no -m flag, a merge, a rebase, etc...

Select from any installed editor. Examples:

  • emacs: emacs
  • vi: vi or vim
@nnja
nnja / less.md
Created October 5, 2017 04:54
A cheatsheet for using less on the command line

Tips for using less on the command line.

To navigate:

  • f = for next page
  • b = for previous page

To search:

  • /&lt;query>
@brizandrew
brizandrew / README.md
Created July 28, 2017 22:07
How to use node.js build routines and npm packages in Django.

Using Node.js With Django

When writing django apps it's easy to ignore the organization of your front end code. Often, these backend coders will just write a static js and css file, stick it in the static directory, and call it a day.

You can also build them as two completely independent parts. With a complex gulp build routine independent of the django app. But if you don't know gulp, node, or those kinds of systems it can be a daunting process to get started with.

Enter django-compressor-toolkit (the name doesn't quite roll off the tongue).

Setting Up Django-Compressor-Toolkit

Using django-compressor and django-compressor-toolkit you can write Javascript ES6 code with all its fancy import/export logic or style your pages with sass instead of css, and leave your deploy routine largely untouched.

Fix Ubuntu package cache

Had problem with Ubuntu package cache.

➜  sources.list.d sudo apt-get update                   
Hit:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease                                                                   
Hit:3 http://fi.archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                 
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease