Skip to content

Instantly share code, notes, and snippets.

View shakthimaan's full-sized avatar

Shakthi Kannan shakthimaan

View GitHub Profile
@shakthimaan
shakthimaan / redblack.ml
Last active February 16, 2020 17:56
Revision 2
open Unix
type colour = R | B
type 'a t =
Lf
| Br of colour * 'a t * 'a * 'a t
let rec list_of_set s =
match s with
@shakthimaan
shakthimaan / foo.js
Created August 5, 2016 11:45
istanbul mocha coverage still shows code as not executed
process.on('exit', () => { // Runs, but coverage report marks these lines as not executed!
log.info('Start !!!');
c.close();
b.close();
a.stop();
log.info('Exit !!!');
});
@shakthimaan
shakthimaan / test.js
Last active May 27, 2016 06:06
socket.write with delay
const net = require("net");
const MACHINE_PORT = 8081;
function* machineDataGenerator() {
yield 'ONE\r\n';
yield 'TWO\r\n';
yield 'THREE\r\n';
}
@shakthimaan
shakthimaan / input-poem.tex
Last active December 12, 2022 17:50
LaTeX poem style
\documentclass{article}
\usepackage{verse}
\begin{document}
\begin{verse}
\poemlines{3}
\setverselinenums{1}{3}
@shakthimaan
shakthimaan / test.tex
Created February 19, 2016 12:07
ifthenelse example
\documentclass{article}
\usepackage{ifthen}
\newcommand{\test}[2]
{
\ifthenelse{\equal{#1}{}}
{#2} % No optional argument Expected: Second
{#2 #1} % With optional argument Expected: Second Argument
}
@shakthimaan
shakthimaan / test.org
Created February 14, 2016 09:34
Suppress $ in org-latex-export-as-latex output

First

The first line.

Second

The second ${\englishfont{Sri, Shri ,Shre}}$ line.

Third

@shakthimaan
shakthimaan / config.sty
Created February 6, 2016 17:39
Uneven twoside margins
\usepackage{geometry}
\geometry{layoutwidth=7.5in,layoutheight=9.5in}
\geometry{layouthoffset=0pt,layoutvoffset=0pt}
\geometry{top=1.5cm,bottom=1.5cm}
\geometry{twoside,hmarginratio=3:2}
@shakthimaan
shakthimaan / test.el
Created February 6, 2016 04:17
replace-regexp on file
(defun org-to-latex-toc ()
"Map org sections to LaTeX ToC."
(interactive)
(let ((case-fold-search nil))
(goto-char 1)
(replace-regexp "^\\\\section" "\\\\chapter")
(goto-char 1)
(replace-regexp "^\\\\subsection" "\\\\section")
(goto-char 1)
(replace-regexp "^\\\\subsubsection" "\\\\subsection")
@shakthimaan
shakthimaan / input.tex
Created January 28, 2016 13:31
Make Tamil font default
%
% xelatex input.tex
%
\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\english}{Liberation Sans}
\newfontfamily{\lohit}[Script=Tamil]{Lohit-Tamil-Classical}
@shakthimaan
shakthimaan / expected-output.txt
Last active January 12, 2016 15:57
Tasks not listed in Kanban board (second TBLFM)
* Kanban board
| TODO | NEXT | STARTED | WAITING | DONE | CANCELED |
|--------+------+---------+-----------+------+----------|
| Book A | | | Blog post | | |
| Book B | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
#+TBLFM: @1='(kanban-headers $#)::@2$1..@>$>='(kanban-zero $# @# "TAG" '("test.org"))