Skip to content

Instantly share code, notes, and snippets.

View liflovs's full-sized avatar
⚔️

Serhii liflovs

⚔️
View GitHub Profile
@koaning
koaning / bionic.py
Last active August 11, 2022 14:05
A custom recipe for Prodigy that mimics Bionic Reading.
import pyphen
import prodigy
from prodigy.components.loaders import JSONL
from prodigy.components.db import connect
hyphenator = pyphen.Pyphen(lang="en_US")
def construct_html(text):
hyphend = hyphenator.inserted(text)

Bionic Reader Bookmarklet

This bookmarklet is inspired by Bionic Reader API that is truly incredible. However I have issues with service APIs that are not clear on how they handle the privacy and security of my data. So I made a quick and dirty bookmarklet to do the job locally.

  • Create a new bookmark in your browser
  • Use this script as the address:
javascript:(function(){!function(){window.hasOwnProperty("bionicWordWrapApplied")||(!function(e){var n,t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,null);for(;n=t.nextNode();){for(var o,r=n.parentNode,d=n.nodeValue;o=d.match(/^(\s*)(\S+)/);){d=d.slice(o[0].length),r.insertBefore(document.createTextNode(o[1]),n);var a=Math.ceil(o[2].length/2),c=r.insertBefore(document.createElement("b"),n);c.appendChild(document.createTextNode(o[2].slice(0,a)));var i=r.insertBefore(document.createElement("span"),n);i.appendChild(document.createTextNode(o[2].slice(a)))}n.nodeValue=d}}(document.body),window.bionicWordWrapApplied=!0
import { build, files, version } from '$service-worker';
// https://github.com/microsoft/TypeScript/issues/11781 - this is needed for TS and ESLint
/// env serviceworker
const globalThis = /** @type {unknown} */ (self);
/// <reference no-default-lib="true"/>
/// <reference lib="es2020" />
/// <reference lib="WebWorker" />
const sw = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (globalThis);
@patchthecode
patchthecode / reset_idea_trial.sh
Created June 29, 2021 22:50 — forked from gulrich1/reset_idea_trial.sh
reset intellij trial
#!/bin/sh
#https://github.com/PythonicNinja/jetbrains-reset-trial-mac-osx/blob/master/runme.sh
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine Rider; do
echo "Closing $product"
ps aux | grep -i MacOs/$product | cut -d " " -f 5 | xargs kill -9
echo "Resetting trial period for $product"
@dannyverp
dannyverp / main.tf
Created March 18, 2021 20:36
Cheap k8s cluster Terraform
provider "google" {
project = "<project>"
region = "us-central1"
}
data "google_client_config" "default" {}
provider "kubernetes" {
load_config_file = false
host = "https://${module.gke.endpoint}"
@unrevised6419
unrevised6419 / bookmarks-to-notion.js
Last active March 26, 2025 04:06
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
@rdyv
rdyv / jsonb.sql
Created May 30, 2020 16:05
JSONB Cheatsheet
-- Copied from https://www.alexedwards.net/blog/using-postgresql-jsonb
-- Create a table with a JSONB column.
CREATE TABLE items (
id SERIAL PRIMARY KEY,
attrs JSONB
);
-- You can insert any well-formed json input into the column. Note that only
-- lowercase `true` and `false` spellings are accepted.
Garena client (LeagueClient UX.exe)
D:/Garena/Games/32771/LeagueClient/LeagueClientUx.exe
"--locale=en_SG"
"--servers.chat.chat_host=sg1.chat.si.riotgames.com"
"--servers.lcds.lcds_host=prod.lol.garenanow.com"
"--servers.lcds.login_queue_url=https://lq.lol.garenanow.com/login-queue/rest/queues/lol"
"--region=SG"
"--parent-client=GarenaPC"
"--no-rads"
"--remoting-auth-token=kItBNgRIncu_Wn6Xgthi3w"
@fnky
fnky / stripe-keys-and-ids.tsv
Last active July 17, 2025 02:41
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@Sominemo
Sominemo / Mono Corp API Proxy Protocol.md
Last active June 19, 2024 13:04
Mono Corp API Proxy

Mono Corp API Proxy Protocol 1.3

This document describes the protocol of Mono Corp API Proxy (MCAP). This protocol is created for Mono PWA project.

Entities

  • Root: describes the publicly available URL path, which contains methods as subfolders;
  • Method: Named public command, the way to interact with MCAP for different actions. A simulated subfolder of Root;
  • Secret Proof: A password, that elevates access rights for the request;
  • Public Method: Generally available method, that is intended to be called by the client app;
  • Service Method: A method, that must not be called by the client app, requires Secret Proof;
  • Response: JSON marshaled output of Method with application/json Content-Type and 200 OK response code;