View Toggle Theme.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alacritty_theme() { | |
theme=$1 | |
config_path=~/.config/alacritty/color.yml | |
if ! test -f "$config_path"; then | |
echo "$config_path does not exists" | |
return | |
fi | |
sed -i "" -e "s/^colors: \*.*/colors: *$theme/g" $config_path |
View Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gre: | |
C1: | |
name: F14 Finder | |
hot_key: F14 | |
code: 107 | |
bundle: com.apple.finder | |
path: /System/Library/CoreServices/Finder.app | |
C2: | |
name: F15 Brave | |
hot_key: F15 |
View Anki Sequenced Renamer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()''' |
View rename.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls | sort -n | rename -n 's/.+/our $i; sprintf("%02d.jpeg", 1+$i++)/e' |
View anki_image_renamer_json.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = t2.id |
View image2pdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
DIR=/Users/bbudhathoki/_Projects/Rejoice/create-pdf | |
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 |