Skip to content

Instantly share code, notes, and snippets.

Avatar

結城浩 / Hiroshi Yuki hyuki

View GitHub Profile
View spacetest.tex
% xalignat*環境の上下のアキを確認
\documentclass[a5paper,10pt]{article}
\usepackage{amsmath,amssymb}
% \usepackage{okumacro}
\begin{document}
\noindent\rule{\textwidth}{1pt}
\begin{xalignat*}{2}
x^2 + y^2 &= r^2 \\
@hyuki
hyuki / kenten.tex
Last active Feb 16, 2021
kenten.tex
View kenten.tex
% \KENTEN{圏点}
% LaTeX美文書第7版の圏点をベースに https://github.com/texjporg/jsclasses/issues/60 を見ました。
\makeatletter
\def\KENTEN#1{%
\ifvmode\leavevmode\else\hskip\kanjiskip\fi \setbox1=\hbox to\z@{\hbox to 1zw{\hss\hss}\hss}%
\@kenten#1\end}
\def\@kenten#1{%
\ifx#1\end \let\next=\relax \else
\raise.63zw\copy1\nobreak #1\hskip\kanjiskip\relax
\let\next=\@kenten
View badarc.tex
\documentclass[a5paper,10pt]{jsarticle}
\usepackage[dvipdfmx]{color,graphicx}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\draw[step=1cm,gray,very thin] (-5,-5) grid (5,5);
\draw (-5,0) -- (5,0);
\draw (0,-5) -- (0,5);
\foreach \r in {0,0.1,...,2} {
@hyuki
hyuki / arc.tex
Last active Feb 12, 2021
arc.tex
View arc.tex
\documentclass[a5paper,10pt]{jsarticle}
\usepackage[dvipdfmx]{color,graphicx}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\draw[step=1cm,gray,very thin] (-5,-5) grid (5,5);
\draw (-5,0) -- (5,0);
\draw (0,-5) -- (0,5);
\foreach \r in {0,0.1,...,2} {
View turing-pattern.rb
#!/usr/bin/env ruby
# cf. https://researchmap.jp/blogs/blog_entries/view/76000/82ceec6feab77462a8f9598c65815d76
NX = 32
NY = 32
NT = 20
W1 = 1
W2 = 1
@world = nil
@hyuki
hyuki / dots.java
Created Jan 1, 2021
dots.java - Create simple background images. (Processing)
View dots.java
int MAX = 100;
int COUNT = 10;
int SIZE = 400;
size(1280, 670);
noStroke();
int id = 100;
for (int hue = 0; hue < 100; hue += 5) {
for (int count = 0; count < 2; count++) {
colorMode(RGB, 255);
@hyuki
hyuki / WebToScrapbox.js
Last active Feb 25, 2022
WebToScrapbox.js - ブラウザで見ているページのタイトルとURLをScrapboxに保存するBookmarklet
View WebToScrapbox.js
/*
* WebToScrapbox.js
* ブラウザで見ているページのタイトルとURLをScrapboxに保存するBookmarklet
*/
function start() {
const project = 'https://scrapbox.io/YOURPROJECT/';
const url = location.href;
const title = document.title;
const body1 = "\n " + title;
const body2 = "\n [" + title + ' ' + url + ']';
@hyuki
hyuki / dynalist-blueline.css
Created Dec 20, 2020
Dynalist CSS example.
View dynalist-blueline.css
.u-use-pref-font {
/* font-family: "Hiragino Mincho ProN"; */
font-family: "Hiragino Gothic ProN";
}
body {
color: black;
}
.node-link {
View ooffee.rb
DATA.each do |w|
h = Hash.new(0)
w.chomp.split(//).map { |c| h[c] += 1 }
if h.keys.select { |key| h[key] % 2 != 0 }.size == 0
puts w
end
end
__END__
put
here
@hyuki
hyuki / a.rb
Last active Oct 14, 2020
N!を素因数分解したときの2の指数について
View a.rb
# N!を素因数分解したときの2の指数について
# cf. https://twitter.com/numachi11111/status/1315844576851050497
# See also: https://oeis.org/A011371
def f(n)
if n == 0
1
else
n * f(n-1)
end
end