Skip to content

Instantly share code, notes, and snippets.

View wtsnjp's full-sized avatar

Takuto Asakura wtsnjp

View GitHub Profile
/*
*
* compile: gcc quicksort.c
* test: ./a.out
*
*/
#include <stdio.h>
enum { SIZE = 9 };
% usage: ptex eupho.tex
\catcode`\@=11
\def\eupho#1{\@eupho #1\relax\@nil}
\def\@eupho#1#2\@nil{#1#2\par
\ifx#1\relax\else\@eupho #2#1\@nil\fi}
\eupho{響け!ユーフォニアム}
\end
# Functions for Hugo
local BLOG_PATH=~/repos/blog.wtsnjp.com
function hg-new() {
cd $BLOG_PATH
hugo new post/$1.md --editor="macdown"
}
function hg-preview() {
%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode
%!TEX spellcheck = en-US
\documentclass{article}
\begin{document}
\makeatletter
% make 🍣 \expandafter again
%#!latex
\documentclass{article}
\usepackage{hyperref}
\let\xtextsf\textsf % `\def\xtextsf#1{\textsf{#1}}' will work
\begin{document}
\section{Hello \textsf{\TeX}} %==>O.K.
" Watson's test vimrc
" Author: wtsnjp
" Website: https://wtsnjp.com
"---------------------------
" Pre
"---------------------------
" Encoding
%#!uplatex
\documentclass[uplatex]{jsarticle}
\usepackage{gotoh}
\makeatletter
\def\formatseq#1{%
\expandafter\@tfor\expandafter\member\expandafter:\expandafter=#1%
\do{\makebox[1.2zw][c]{\member}}}
\makeatother
\begin{document}
\Gotoh[gap char={☃}]{GACTA}{GAGA}
%#!latex
\documentclass{article}
\makeatletter
\def\reverse#1{\@reverse#1\relax\@nil\@empty}
\def\@reverse#1#2\@nil#3{%
\ifx#1\relax#3\else
\@reverse#2\@nil{#1#3}%
\fi}
\edef\abcde{\reverse{abcde}}
#
# usage: python ccs.py {file path}
#
import sys
import re
import collections
from matplotlib import pyplot as plt
def get_cs(fn):
@wtsnjp
wtsnjp / exercise11.5.tex
Last active September 16, 2017 13:09
The TeXbook exercise 11.5
%#!latex
\documentclass{article}
\makeatletter
\def\demobox{\bgroup\catcode`\ =12\relax\xx@demobox}
\def\xx@demobox#1{%
\fboxsep=0pt\fboxrule=.4pt
\fbox{%
\fboxrule=3\fboxrule
\xx@demob@x#1\relax}%