Skip to content

Instantly share code, notes, and snippets.

View ckunte's full-sized avatar

Chetan Kunte ckunte

View GitHub Profile
@ckunte
ckunte / smallcaps.typ
Created April 18, 2024 03:54
Turn uppercase words into smallcaps in Typst
// Small caps ( see: https://github.com/typst/typst/discussions/3927 )
// Turn uppercase letters to small caps: use #sc([WORDINCAPS])
// for those that escape the REGEX match
#let sc(content) = text(features: ("c2sc",))[#content]
// For testing, comment the above line, and uncomment the line below
// let sc(content) = text(features: ("c2sc",))[#highlight(content)]
// Turn all uppercase words (any 2 or more grouping of A-Z
// ASCII characters) into small caps
@ckunte
ckunte / ctd.py
Last active April 4, 2024 03:06
Compile Typst document to PDF using Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Compile Typst document
ctd.py 2024 ckunte
Usage: ctd.py (-f <file>)
ctd.py --help
ctd.py --version
@ckunte
ckunte / integrity-hash.sh
Created March 12, 2024 06:33
Generate SHA384 hash for file integrity check attribute in link and script tags
#!/usr/bin/env bash
# 2024 ckunte
cat <filename> | openssl dgst -sha384 -binary | openssl base64 -A | pbcopy
@ckunte
ckunte / books-read.csv
Created February 13, 2024 09:20
Books read to-date
Author Title Read (y) Like?
Arlene Pellicane Calm, Cool, and Connected 2024 Y
Brene Brown The Power of Vulnerability 2023 Y
Yuval Noah Harari Sapiens: A Brief History of Humankind 2023 Y
Yuval Noah Harari Homo Deus: A Brief History of Tomorrow 2023 Y
Yuval Noah Harari 21 Lessons for the 21st Century 2023 Y
Glen van Brummelen Trigonometry 2021 Y
William Zinsser On Writing Well - 30Ed 2021 Y
Mark Manson The Subtle Art of Not Giving a F*ck 2021 O
David Acheson The Calculus Story 2021 Y
@ckunte
ckunte / datestamp-in-vim.md
Created January 14, 2024 11:31
Get date stamp (in Y-m-d H:M format) in Vim from an abbreviation (ds)
abbr <expr> ds strftime('%Y-%m-%d %H:%M')
@ckunte
ckunte / datestamp-in-sublimetext.md
Last active January 14, 2024 11:30
Get date stamp (in Y-m-d H:M format) in Sublime Text from a shortcut (ctrl+shift+d)
  1. From Tools → Developer → New Plugin... within Sublime Text, replace the template with the following python script:

    import sublime
    import sublime_plugin
    from datetime import datetime
    
    class InsertFormattedDateCommand(sublime_plugin.TextCommand):
        def run(self, edit):

formatted_date = datetime.now().strftime("%Y-%m-%d %H:%M")

@ckunte
ckunte / search-email.md
Created May 6, 2023 06:33
Email search (to add rule) in Fastmail

Email search (to add rule) in Fastmail

Fastmail has nice search email options. Here is an example: search for email from either linkedin.com or booking.com, received before:1y, which can be added as a rule to process the findings further.

from:(linkedin.com OR booking.com) AND before:1y
@ckunte
ckunte / wsl-howto.md
Last active May 1, 2023 09:49
Access linux environment from within Windows (via Windows Subsystem for Linux)

Access linux environment from within Windows

via Windows Subsystem for Linux (WSL)

Ubuntu (a debian linux distribution) in Windows Terminal powered by WSL.

Ubuntu (a debian linux distribution) in Windows Terminal powered by WSL.

Purpose

@ckunte
ckunte / mkmtm.sh
Created December 26, 2021 14:36
Compiling mtm from source
#!/usr/bin/env bash
if ! [ -d "./mtm" ] ; then
git clone --depth=1 https://github.com/deadpixi/mtm.git
fi
if [ -d "./mtm" ] ; then
cd './mtm' || return
git pull --ff-only
make clean
make CURSESLIB=curses
echo "Run sudo make install in './mtm' for a good compile."
@ckunte
ckunte / mkvim.sh
Last active December 26, 2021 14:35
Compiling Vim from source with Python3 interpreter enabled
#!/usr/bin/env bash
if ! [ -d "./vim" ] ; then
git clone --depth=1 https://github.com/vim/vim.git
fi
if [ -d "./vim" ] ; then
cd './vim/src' || return
git pull --ff-only
make distclean
./configure --enable-python3interp
make