Skip to content

Instantly share code, notes, and snippets.

@krmanik
krmanik / Readme.md
Created September 28, 2021 11:59
Create Anki deck using Jupyter Notebook

Where to use the notebook?

Google Colab

Download raw csv_to_anki_apkg.ipynb file and upload to https://colab.research.google.com

How to use this?

  1. Add CSV/TSV file in same directory
  2. Run Second cell to install genanki
  3. Run Next cell and enter
  • csv/tsv filename
  • deck title
@krmanik
krmanik / tsv_to_db.py
Created February 27, 2021 15:02
Create sqlite db file from TSV file
# change file name, column name and table name
import os
import csv
import sqlite3
def convert():
# enter database file name
conn = sqlite3.connect("chinese_data.db")
@krmanik
krmanik / main.py
Created February 7, 2021 20:01
Generate Anki Deck from words data
#https://github.com/infinyte7/Anki-Chinese-Vocabulary-Generator/issues/6#issuecomment-773566513
import random
import genanki
from glob import glob
from os.path import join
anki_deck_title = "Anki Deck"
anki_model_name = "Sample Model"
@krmanik
krmanik / jisho-api.md
Created December 19, 2020 05:50
Get japanese character's meaning and reading from jisho
https://jisho.org/api/v1/search/words?keyword=

If words.txt file contains following japanese characters

学
好
但

Then using following scripts, reading and meaning can be fetched.

@krmanik
krmanik / fakeroot-tcp.sh
Last active February 2, 2022 18:10
Setup fakeroot (tcp) without SystemV IPC support
#!/bin/bash
cd /tmp
wget http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.27.orig.tar.gz
tar xvf fakeroot_1.27.orig.tar.gz
cd fakeroot-1.27/
./bootstrap
./configure --prefix=/opt/fakeroot \
--libdir=/opt/fakeroot/libs \
--disable-static \
@krmanik
krmanik / fakeroot.sh
Created August 2, 2020 12:24
Setup fakeroot inside termux arch linux
#!/bin/bash
set -ex
cd /tmp
#pacman -S --needed --noconfirm base-devel
#git clone https://aur.archlinux.org/nosudo
#cd nosudo
#makepkg -o
#cp nosudo /bin/sudo
@krmanik
krmanik / versionPopup.html
Last active December 22, 2020 20:05
Adding version popup in Anki Deck description
<style>
.popup {
position: relative;
display: inline-block;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@krmanik
krmanik / front.html
Last active July 11, 2020 05:02
Add Google translate option to a a page
<div id="translate_this_page"></div>
<script type="text/javascript">
function googleTranslateElement() {
new google.translate.TranslateElement(
{pageLanguage: 'en'}, // Language can be changed here
'translate_this_page'
);
}
</script>