This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* compile: gcc quicksort.c | |
* test: ./a.out | |
* | |
*/ | |
#include <stdio.h> | |
enum { SIZE = 9 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX TS-program = lualatex | |
%!TEX encoding = UTF-8 Unicode | |
%!TEX spellcheck = en-US | |
\documentclass{article} | |
\begin{document} | |
\makeatletter | |
% make 🍣 \expandafter again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!latex | |
\documentclass{article} | |
\usepackage{hyperref} | |
\let\xtextsf\textsf % `\def\xtextsf#1{\textsf{#1}}' will work | |
\begin{document} | |
\section{Hello \textsf{\TeX}} %==>O.K. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Watson's test vimrc | |
" Author: wtsnjp | |
" Website: https://wtsnjp.com | |
"--------------------------- | |
" Pre | |
"--------------------------- | |
" Encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# usage: python ccs.py {file path} | |
# | |
import sys | |
import re | |
import collections | |
from matplotlib import pyplot as plt | |
def get_cs(fn): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!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}% |
OlderNewer