Skip to content

Instantly share code, notes, and snippets.

View uroybd's full-sized avatar

Utsob Roy uroybd

View GitHub Profile
@uroybd
uroybd / koreader notes.md
Created February 20, 2024 08:26
A tweaked version of KOReader to Obsidian exporter template

<%* // The KOReader defined highlight styles vs callout mapping. Leave the keys as is, but you can edit the values to create your own convention. const NOTE_STYLES = { lighten: { type: "quote", title: "Quotable/Concept/General Idea", }, invert: { type: "important", title: "Striking/Intense",

@uroybd
uroybd / Inbox.md
Last active November 29, 2023 10:38
Obsidian Letter to Self.
title aliases created updated
Inbox
Inbox
2023-11-22 14:01:18 +0600
2023-11-23 08:49:57 +0600

Will Be Delivered soon…

// I am using Custom JS plugin to define common JS functions throughout the vault.
const {Formatters} = customJS;
@uroybd
uroybd / Boox Highlights.js
Last active October 5, 2023 03:27
Obsidian Boox Highlight formatter
<%*
// Note style prefixes we will map to callouts.
// It will suffice to put just this character to change the callout style.
// If additional notes are required, we will use a space after the prefix,
// and then continue to our usual note.
// Customize this as you see fit. With types from: https://help.obsidian.md/Editing+and+formatting/Callouts#Supported+types
const NOTE_STYLES = {
"!": {
type: "important",
title: "Striking/Intense",
@uroybd
uroybd / Boox minimal.md
Last active August 5, 2023 15:55
A minimal boox to obsidian converter for templater

<%* function getTitleAndAuthor(l) { l = l.replace("Reading Notes | <<", "").split(">>"); return { title: l[0], authors: l[1] } }

let file = app.workspace.getActiveFile()

@uroybd
uroybd / formatter_class.js
Last active December 31, 2022 05:10
Obsidian yearly goals
class Formatters {
format_book_collections(collections, dv) {
if (collections) {
const keys = Object.keys(collections);
const links = dv
.pages('"Personal/Reading/Collections"')
.where(
(p) =>
p.handle != undefined &&
keys.indexOf(p.handle) > -1
@uroybd
uroybd / day8_2.rs
Created December 9, 2021 03:34
A not so elegant solution of Advent of Code 2021: Day 8, Part 2
use std::collections::HashMap;
pub fn read_lines(filename: String) -> Vec<String> {
let content: Vec<String> = fs::read_to_string(filename)
.expect("Invalid File")
.split('\n')
.map(|s| s.to_string())
.collect();
return content;
}
@uroybd
uroybd / large_small.py
Created June 29, 2020 11:46
Largest and Smallest
import sys
largest_by_far = sys.float_info.min
smallest_by_far = sys.float_info.max
while True:
value = input("Enter Numbers: ")
if value == "done":
break
try:
fvalue = float(value)
@uroybd
uroybd / createGlossary.py
Created April 18, 2020 18:48
Creating Stardict from python dict.
import csv
MY_DICT = {"a": "a definition"} # assuming this is your dict
data = list(MY_DICT.items())
with open('glossary.txt', 'w') as gfile:
writer = csv.writer(gfile, delimiter="\t")
writer.writerows(data)

Keybase proof

I hereby claim:

  • I am uroybd on github.
  • I am uroybd (https://keybase.io/uroybd) on keybase.
  • I have a public key ASDAvqxhvhTXcjkzLfpaldu_T9EmLDU80ej4KEkZY2MyQAo

To claim this, I am signing this object:

@uroybd
uroybd / bengaliUnit.js
Last active February 10, 2018 13:04
Javascript Regex to get 'Units' from Bengali text. (Useful for text transforming bengali with JS)
var bengaliUnitRegex = /([অ-হড়-য়](্[অ-হড়-য়])+|[অ-হড়-য়]্|[অ-হড়-য়])[া-ৌ]*[ঁঃং]*|ৎ|[০-৯]| /g;
// You can match with str.mathc(rg) and it will yield units as array. Example:
var testText = "আদর্শলিপি";
testText.match(bengaliUnitRegex);
// > ["আ", "দ", "র্শ", "লি", "পি"]