Skip to content

Instantly share code, notes, and snippets.

View salif's full-sized avatar

Salif Mehmed salif

  • open to work
  • Bulgaria
  • 13:09 (UTC +03:00)
View GitHub Profile
@salif
salif / patch.sh
Last active March 19, 2024 13:37
Fix Gleam indentation on Arch Linux
# git clone https://aur.archlinux.org/gleam.git
pkgver="1.0.0"
EDITOR=${EDITOR:-micro}
makepkg --nobuild
cd src/
cp -r gleam-$pkgver gleam-$pkgver-new
$EDITOR gleam-$pkgver-new/compiler-core/src/format.rs
# - const INDENT: isize = 2;
@salif
salif / README.md
Last active August 26, 2023 23:44
Alegreya font for WriteFreely (Normal+Bold+Italic)

Alegreya font for WriteFreely (Normal+Bold+Italic)

Choose style.css or style.min.css (minified css), copy its contents, and paste it into Custom CSS on Writefreely.

@salif
salif / README.md
Created November 14, 2022 18:26
Edit Markdown Table

Example

edit_markdown_table(`
|key|value|
|:-|-:|
|a|1|
|b|2|
|c|3|
`, [1, 0])
@salif
salif / README.md
Last active February 11, 2024 16:59
Memrise - Sort courses by length / amount of words

Memrise - Sort courses by length / amount of words

  • Go to app.memrise.com/community/courses
  • Open Developer tools and go to the Console tab
  • Copy the code from script.js from this gist, then paste it into the console and hit enter
  • Done!
@salif
salif / script.sh
Last active January 24, 2024 20:39
Linux grep locales
LANG=$(printf "$LC_MESSAGES" | cut -d '_' -f 1)
mkdir -p /tmp/${LANG}_locale
find /usr/share/locale/${LANG}/LC_MESSAGES/ -name '*.mo' | xargs -I "{}" sh -c "msgunfmt {} >> /tmp/${LANG}_locale/\$(basename {})"
grep -i -A 1 "" /tmp/${LANG}_locale/*.mo
@salif
salif / console-script.js
Created July 16, 2022 21:27
Clear Memrise List; Remove all words
var s_a;
function s_f() {
const s_b = document.querySelector('i[data-role="remove"');
if (s_b == undefined) {
clearInterval(s_a);
return;
}
s_b.click();
document.querySelector('a[tabIndex="4000"]').click();
}
@salif
salif / README.md
Created July 13, 2022 10:15
Transliterate a Web Page

Example

transliterate_page({ "Ĉ": "Cx", "Ĝ": "Gx", "Ĥ": "Hx", "Ĵ": "Jx", "Ŝ": "Sx", "Ŭ": "Ux", "ĉ": "cx", "ĝ": "gx", "ĥ": "hx", "ĵ": "jx", "ŝ": "sx", "ŭ": "ux" })

Before transliteration

Ĉiuliteraĵo
@salif
salif / get_json.js
Created February 22, 2022 23:37
Get JSON with all words from pbd171.db
const words = require('./temp.json')
const fs = require('fs')
for (let i = 0; i < words.length; i+=1904) {
const lcode = 'word_'+words[i].lan_code
for (let j = 0; j < 1904; j++) {
words[j][lcode] = words[i+j].word
}
}

Keybase proof

I hereby claim:

  • I am salif on github.
  • I am salifm_ (https://keybase.io/salifm_) on keybase.
  • I have a public key ASA-FPLiI7Tx156koKlscfJlcMU6md-SI-rznIAgb3b_9Ao

To claim this, I am signing this object:

@salif
salif / README.md
Created June 15, 2021 15:48
Calibre | Replace Liberation font with different font on Arch Linux

Remove ttf-liberation

sudo -i
pacman -Rdd ttf-liberation
rm /usr/share/calibre/fonts/liberation/Liberation*.ttf

Option 1: noto-fonts