Skip to content

Instantly share code, notes, and snippets.

View voznik's full-sized avatar
🤔
Open for opportunities

Vadym Parakonnyi voznik

🤔
Open for opportunities
View GitHub Profile
@ernstki
ernstki / fc-reject.pl
Last active January 19, 2025 21:44
Easily disable fonts that aren't in your language, for Debian and derivatives (and possibly other Linux distros)
#!/usr/bin/env perl
##
## Easily disable fonts that aren't for your language, or language-specific
## variants from large font families like Noto -- WITHOUT uninstalling them
##
## Authors: Kevin Ernst <ernstki -at- mail.uc.edu>, @wdoekes
## License: MIT or CC-BY-SA-4.0, at your option
## Source: https://gist.github.com/ernstki/2ae279ad89888e4099c9852bf0ba5d11
##
## Usage:
@scanzy
scanzy / tewaker.py
Created April 28, 2023 11:00
Set custom id/class in Streamlit, and inject css/js
import random as rd
import functools as ft
import streamlit as st
import streamlit.components.v1 as components
# Domanda: come applicare stili css solo ad alcuni elementi streamlit?
# Risposta: iniettare js che aggiorni id e classe dell'elemento precedente
@reubenmiller
reubenmiller / tedge-cross-compile-with-zig.md
Last active May 20, 2024 09:56
How to cross compile tedge using zig

How to cross compile a rust project using zig? wtf.

I was able to compile and cross compile the gnu and musl variants to all of our target triples :)

  1. Install the cargo-zigbuild and dependencies (requires python3)

    pip3 install ziglang
    cargo install cargo-zigbuild
@kylerummens
kylerummens / supabase-angular-auth-with-rxjs.md
Created December 18, 2022 05:43
Supabase Angular authentication with RxJS Observables

Overview

The goal of this example is to build a more powerful authentication system in our Supabase Angular applications by leveraging RxJS Observables.

Supabase has a great tutorial that explains how to set up your Angular app to work with Supabase, but while that tutorial works with Angular, I wouldn't say it's built for angular.

When you create a new Angular app with the Angular CLI, baked-in is the powerful library, RxJS. Let's combine the ease of Supabase with the power of RxJS.

Another important addition that I will lay out is the ability to seamlessly combine a public.profiles table with your auth.users table from Supabase Auth. Many (if not most) applications need to store more data about their users than what sits in the auth.users table in your database, which is where Supabase Auth pulls from. With RxJS Observables and Supabase Realtime, any changes to our user's profile can immediately be

@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
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) {
@joaquinicolas
joaquinicolas / gist:b7d0a0869485bca5156d0d4be87820f4
Created December 15, 2021 02:59
Setup flutter environment in arch linux
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
yay -S flutter
java -version
sudo pacman -S jre8-openjdk
@eneajaho
eneajaho / config.md
Last active March 2, 2025 20:23
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

@MariusBongarts
MariusBongarts / medium-highlighter.js
Last active March 19, 2024 14:02
MediumHighlighter - Custom element
class MediumHighlighter extends HTMLElement {
get markerPosition() {
return JSON.parse(this.getAttribute("markerPosition") || "{}");
}
get styleElement() {
return this.shadowRoot.querySelector("style");
}
get highlightTemplate() {
@romain-trotard
romain-trotard / UnderTheHoodOfReactEventListener.md
Last active March 22, 2025 13:19
Under the hood of event listeners in React

Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.

At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.

The misconception

Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.

For example when I write this simple code: