Skip to content

Instantly share code, notes, and snippets.

@doraTeX
doraTeX / ipaex-vs-sourcehansans.tex
Last active Feb 8, 2020
IPAex Gothic にあって Source Han Sans にないグリフをリストアップ
View ipaex-vs-sourcehansans.tex
%#!xelatex
\documentclass[xelatex]{bxjsarticle}
\usepackage{xltxtra}
\usepackage{multicol}
\pagestyle{empty}
\ExplSyntaxOn
\NewDocumentCommand{\codepoint}{m}{
U+
\int_compare:nNnTF{#1}<{"1000}{0}{}
@doraTeX
doraTeX / unzip.py
Last active Aug 3, 2020
Windowsで作られた日本語ファイル名入りのZIPアーカイブにも対応した unzip 用 Python スクリプト
View unzip.py
#!/usr/bin/env python3
import sys
import re
from zipfile import ZipFile
from getpass import getpass
if len(sys.argv) == 1:
print("Usage: {} ZIP_FILE(S)...".format(sys.argv[0]))
exit(0)
@doraTeX
doraTeX / MagneticStirrer.svg
Last active Dec 27, 2019
SVG graphics of a magnetic stirrer ( trace of Ruhrfisch's work (GFDL), https://commons.wikimedia.org/wiki/File:Magnetic_Stirrer.JPG )
View MagneticStirrer.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doraTeX
doraTeX / README.md
Last active Jul 31, 2020
引数に与えられた日本語文字列を形態素解析しひらがなに変換して出力するコマンドラインユーティリティ on macOS
View README.md

コンパイル法

Objective-C 版

$ clang -framework Foundation -o ToHiragana ToHiragana.m  

Swift 版

@doraTeX
doraTeX / saizeriyaKnapsackDP.tex
Last active May 20, 2019
「サイゼリヤで1000円あれば最大何kcal摂れるのか」をTeX言語で計算する ~TeX言語で動的計画法(DP)~ https://doratex.hatenablog.jp/entry/20190520/1558323856
View saizeriyaKnapsackDP.tex
%#!(u)platex
\documentclass[dvipdfmx,autodetect-engine]{jsarticle}
\usepackage{pgffor}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\tcbset{enhanced jigsaw,colback=red!5!white,colframe=red!75!black,breakable,fonttitle=\gtfamily,before upper=\setlength\parindent{1zw}}
\makeatletter
@doraTeX
doraTeX / uuid.sty
Created Apr 30, 2019
A LaTeX package for generating UUID Version 4
View uuid.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{uuid}[2019/04/30 v0.1]
\newif\ifuuid@lowercase
\uuid@lowercasefalse
\DeclareOption{lowercase}{\uuid@lowercasetrue}
\ProcessOptions\relax
@doraTeX
doraTeX / randomshuffle.sty
Last active Jan 18, 2019
A LaTeX package for random shuffling
View randomshuffle.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{randomshuffle}[2019/01/18 v0.2]
\RequirePackage{keyval}
\ifdefined\pdfuniformdeviate
\let\randomshuffle@uniformdeviate\pdfuniformdeviate
\let\randomshuffle@setrandomseed\pdfsetrandomseed
\else\ifdefined\uniformdeviate
\let\randomshuffle@uniformdeviate\uniformdeviate
\let\randomshuffle@setrandomseed\setrandomseed
@doraTeX
doraTeX / currentpage.tex
Last active May 15, 2019
jsarticle + mag + gentombow + pdfbox + pxpgfmark の両立実験
View currentpage.tex
% (u)pLaTeX + dvipdfmx
\documentclass[8pt,b6paper,dvipdfmx,autodetect-engine,tombo]{jsarticle}
\usepackage[pdfbox]{gentombow}
\usepackage{tikz}
\usepackage{pxpgfmark}
\def\test{%
\begin{tikzpicture}[remember picture, overlay]
\coordinate (NE) at (current page.north east);
@doraTeX
doraTeX / generateQRcode.swift
Last active Feb 15, 2019
QR Code Generator written in Swift 4
View generateQRcode.swift
import Quartz
extension CGImage {
class func qrCodeImage(from string: String, scale: CGFloat = 1) -> CGImage? {
let stringData = string.data(using: .utf8)
let transform = CGAffineTransform(scaleX: scale, y: scale)
guard let filter = CIFilter(name: "CIQRCodeGenerator") else {
return nil
}
View Sierra-FontList.txt
32 /System/Library/Fonts/Apple Braille Outline 6 Dot.ttf
36 /System/Library/Fonts/Apple Braille Outline 8 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 6 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 8 Dot.ttf
16 /System/Library/Fonts/Apple Braille.ttf
88304 /System/Library/Fonts/Apple Color Emoji.ttc
532 /System/Library/Fonts/Apple Symbols.ttf
17096 /System/Library/Fonts/AppleSDGothicNeo.ttc
12980 /System/Library/Fonts/AquaKana.ttc
64 /System/Library/Fonts/ArialHB.ttc
You can’t perform that action at this time.