Skip to content

Instantly share code, notes, and snippets.

View dhawangayash's full-sized avatar

Dhawan Gayash dhawangayash

  • SF Bay Area
View GitHub Profile

org-mode syntax - superscripts and subscripts example 1

  • Add #+OPTIONS: ^:{} to your org-mode file to explicitly enable superscripts and subscripts.
superscripts
To create a superscript put ^{ characters at the start of the superscript text and } at the end of the superscript text, e.g. word^{superscript} will render as wordsuperscript.
subscripts
To create a subscript put _{ characters at the start of the subscript text and } at the end of the subscript text, e.g. word_{subscript} will render as wordsubscript.
Keychord to enable
To enable pretty entites toggle in org mode use M-x org-toggle-pretty-entities
@dhawangayash
dhawangayash / WorkingWithDateTime.java
Created July 12, 2018 18:47
Working with Java LocaleDateTime and Date Utils
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Date;
/**
* Must read articles to understand this better
* https://stackoverflow.com/questions/21242110/convert-java-util-date-to-java-time-localdate
* https://stackoverflow.com/questions/33066904/localdate-to-java-util-date-and-vice-versa-simplest-conversion
* https://stackoverflow.com/questions/35183146/how-can-i-create-a-java-8-localdate-from-a-long-epoch-time-in-milliseconds
@dhawangayash
dhawangayash / zathu
Created November 21, 2017 01:38 — forked from michaelmrose/zathu
zathura config
# Zathura configuration file
# See man `man zathurarc'
# Open document in fit-width mode by default
set adjust-open "best-fit"
# One page per row by default
set pages-per-row 1
#stop at page boundries
@dhawangayash
dhawangayash / QuickSelect.java
Created November 19, 2017 03:41 — forked from unnikked/QuickSelect.java
A basic implementation of quickselect algorithm in Java. Intentionally unused generics.
import java.util.Arrays;
/**
* quickselect is a selection algorithm to find the kth smallest element in an
* unordered list. Like quicksort, it is efficient in practice and has good
* average-case performance, but has poor worst-case performance. Quickselect
* and variants is the selection algorithm most often used in efficient
* real-world implementations.
*
* Quickselect uses the same overall approach as quicksort, choosing one