Skip to content

Instantly share code, notes, and snippets.

flee2free / Toggle
Last active June 2, 2021 23:43
Alacritty - NVim : Upadate Light/Dark Mode
View Toggle
alacritty_theme() {
if ! test -f "$config_path"; then
echo "$config_path does not exists"
sed -i "" -e "s/^colors: \*.*/colors: *$theme/g" $config_path
flee2free / Config
Created May 7, 2021 13:22
Keyboard Maestro Launcher Macro
View Config
name: F14 Finder
hot_key: F14
code: 107
path: /System/Library/CoreServices/
name: F15 Brave
hot_key: F15
flee2free / Anki Sequenced
Created April 22, 2021 09:56
Export the randomly generated study card as a PDF
View Anki Sequenced
import json
import os
import sqlite3
import zipfile
import glob
import re
import shutil
'''Renaming the ANKI media file with its original filename, once you rename upload these
to Google Drive - get the url mapped with file name and run tag_drive_path()'''
flee2free /
Last active April 11, 2021 14:25
[Terminal File Rename] Renaming files in sequece using numeric sort #bash
ls | sort -n | rename -n 's/.+/our $i; sprintf("%02d.jpeg", 1+$i++)/e'
flee2free / anki_image_renamer_json.sql
Last active April 10, 2021 14:05
[ANKI Image File Rename] Extract the image resource, rename preserving the sort order #sql #anki
View anki_image_renamer_json.sql
SELECT json_group_object(
trim(file_name), sequence_id
) AS json_result
FROM (select t2.sfld as file_name, t1.due, row_number() over (order by t1.due) as sequence_id
from cards t1
inner join (
select id, flds, sfld, mid
from notes
) t2
on t1.nid =
flee2free /
Last active April 11, 2021 14:24
[Image into PDF] Converting Images into PDF using PDF Make #javascript #bash
rm -rf "$DIR/data/" "$DIR/pdfs/" 2> /dev/null
mkdir -p $DIR/{data,pdfs} 2> /dev/null
cp -rf ./ "$DIR/data/"
cd $DIR || exit
node ./index.js