Skip to content

Instantly share code, notes, and snippets.

View IlanFrumer's full-sized avatar

Ilan Frumer IlanFrumer

  • Israel , Nahariya
View GitHub Profile
@IlanFrumer
IlanFrumer / node-sqlite.ts
Last active September 4, 2024 07:20
node:sqlite
import { DatabaseSync } from "node:sqlite";
export class Fetcher {
private database: DatabaseSync;
constructor() {
this.database = new DatabaseSync('cache.db', { open: true });
this.database.exec(`
CREATE TABLE IF NOT EXISTS cache (
uri TEXT PRIMARY KEY,
@IlanFrumer
IlanFrumer / arc.wikipedia.hebrew.user.js
Created April 8, 2024 16:01
Convert Classical Syriac text to Hebrew script on Wikipedia
// ==UserScript==
// @name Classical Syriac Wikipedia to Hebrew
// @namespace http://tampermonkey.net/
// @version 2024-04-08
// @description Convert Classical Syriac text to Hebrew script on Wikipedia
// @author [email protected]
// @match https://arc.wikipedia.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=wikipedia.org
// @grant none
// ==/UserScript==
@IlanFrumer
IlanFrumer / git-super-log.ts
Last active September 1, 2022 16:34
Git log working hours per day
import moment from "https://deno.land/x/[email protected]/mod.ts";
import { parse } from "https://deno.land/[email protected]/flags/mod.ts";
export const DELIMITER = "隔";
interface DailyCommits {
start: moment.Moment;
end: moment.Moment;
commits: number;
messages: string[];
@IlanFrumer
IlanFrumer / mapMulti.ts
Created August 12, 2022 09:54
Map an array to multiple values (fixed or random)
const randomize = (min: number, max: number) =>
Math.floor(Math.random() * (max - min + 1)) + min;
export const mapMulti = (val1: number, val2?: number) => {
let iterator: () => unknown[];
if (typeof val2 === "undefined") {
const arr = Array.from({ length: val1 });
iterator = () => arr;
} else {
iterator = () => Array.from({ length: randomize(val1, val2) });
@IlanFrumer
IlanFrumer / peshitta-hebrew-letters.js
Last active February 2, 2022 10:07
Transform peshitta into hebrew letters
// npm install fast-glob
// wget https://github.com/ETCBC/peshitta/archive/refs/tags/v0.5.zip && unzip v0.5.zip
const fg = require("fast-glob");
const path = require("path");
const fs = require("fs");
const SyriacMap = {
ܐ: /* Aleph */ "א",
ܒ: /* Beth */ "ב",
@IlanFrumer
IlanFrumer / arch-interception-tools.sh
Last active April 9, 2023 14:11
interception-tools arch
# Install packages
sudo pacman -S interception-tools interception-caps2esc --noconfirm
# Enabled udevmon service
sudo systemctl enable --now udevmon
# Restart when udevmon.yaml changes
sudo systemctl restart udevmon.service
@IlanFrumer
IlanFrumer / MouseTab.mjs
Created June 29, 2021 10:32
MouseTab - Tab the mouse pointer netween monitors
#!/usr/bin/node
// @ts-check
import { execSync } from "child_process";
function getScreens() {
const screen_pattern = "([0-9]+)x([0-9]+)\\+([0-9]+)\\+([0-9]+)";
const screen_regexp = new RegExp(screen_pattern, "gm");
const screen_lines = execSync(
`xrandr --current | grep -oP "${screen_pattern}"`,
{
@IlanFrumer
IlanFrumer / component.html
Last active February 17, 2021 11:59
Flex Gap Polyfill
<div class="container">
<div class="parent">
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
</div>
</div>
<div class="container" dir="rtl">
<div class="parent">
@IlanFrumer
IlanFrumer / .zshrc
Last active June 12, 2020 14:45
antibody zsh setup for ubuntu server
ZSH_THEME="bira"
DISABLE_AUTO_UPDATE="true"
source <(antibody init)
antibody bundle robbyrussell/oh-my-zsh kind:dummy
export ZSH=$(antibody path robbyrussell/oh-my-zsh)
antibody bundle robbyrussell/oh-my-zsh
antibody bundle robbyrussell/oh-my-zsh path:plugins/git
antibody bundle robbyrussell/oh-my-zsh path:plugins/pip
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>proto</string>
</array>
<key>keyEquivalent</key>
<string>^~P</string>