Skip to content

Instantly share code, notes, and snippets.

View astronasutarou's full-sized avatar

Ryou Ohsawa astronasutarou

View GitHub Profile
@astronasutarou
astronasutarou / croppdf.sh
Created April 23, 2024 05:33
A bash script to crop out the margins of the PDF file.
#!/bin/bash
INPUT=${1:?}
OUTPUT=${2:-${INPUT//.pdf/-crop.pdf}}
get_bbox() {
gs -sDEVICE=bbox \
-dBATCH -dNOPAUSE \
-c save pop \
-f ${INPUT} 2>&1 \
| grep 'HiResBoundingBox' \
@astronasutarou
astronasutarou / post.arXiv.org.to.scrapbox.user.js
Created May 18, 2021 17:17
Greasemonky script to post an arXiv entry to your Scrapbox.io
// ==UserScript==
// @name post new paper to Scrapbox
// @description post arXiv.or.js to your Scrapbox.io
// @namespace http://xr0038.net
// @include https://arxiv.org/abs/*
// @run-at document-end
// @version 1
// ==/UserScript==
(function(Scrapbox){
@astronasutarou
astronasutarou / Universal.gpl
Created March 18, 2019 00:25
色覚の多様性に配慮した案内・サイン・図表等用のカラーユニバーサルデザイン推奨配色を inkscape 等で使用するためのパレット (cf. http://jfly.iam.u-tokyo.ac.jp/colorset/)
GIMP Palette
Name: Color Universal Design
Columns: 1
#
255 75 0 J08-50V
255 241 0 J27-85V
3 175 122 J46-60T
0 90 255 J72-40T
77 196 255 J69-70P
255 128 130 J02-70T
@astronasutarou
astronasutarou / JISSafeColor.gpl
Last active March 18, 2019 00:23
JIS 安全色 (JIS Z 9103) の色を inkscape 等で使うためのパレット (cf. http://safetycolor.jp/shiteichi/)
GIMP Palette
Name: JIS Safe Color
Columns: 1
#
255 75 0 J08-50V
246 170 0 K15-65X
242 231 0 K27-80V
0 176 107 K45-55T
25 113 255 K72-45T
153 0 153 K89-40T
@astronasutarou
astronasutarou / MyDefinition.tex
Last active January 17, 2019 14:04
初回とそれ以降で評価される内容が異なるコマンドをつくる
\documentclass[a4paper]{jsarticle}
\usepackage{xspace}
\usepackage{etoolbox,etextools}
\makeatletter
\newcommand*{\MyDefinition}[3]{%
\newtoggle{\string#1}%
\togglefalse{\string#1}%
\DeclareRobustCommand*#1{%
\@ifstar{\csname s\string#1\endcsname}{\csname n\string#1\endcsname}}%
@astronasutarou
astronasutarou / file0.txt
Last active December 29, 2017 06:52
gnuplot でポン・デ・リング ref: https://qiita.com/xr0038/items/ddbecc69902888b4fa4a
splot Z(x,y) t "Z は座標 (x,y) での z 座標を返す関数"
@astronasutarou
astronasutarou / amazon.url.cleaner.user.js
Last active January 9, 2023 21:39
amazon.co.jp の url から余分なものを取り去って綺麗にする
// ==UserScript==
// @name Amazon URL Cleaner
// @namespace http://xr0038.net
// @description Clean Amazon item URL
// @include http://www.amazon.co.jp*/dp/*
// @include https://www.amazon.co.jp*/dp/*
// @include http://www.amazon.co.jp*/gp/*
// @include https://www.amazon.co.jp*/gp/*
// @run-at document-start
// @version 1.2
@astronasutarou
astronasutarou / banana.svg
Last active September 15, 2017 14:00
original image created by @niewals (see https://twitter.com/niewals/status/869526811020939264/ )
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astronasutarou
astronasutarou / mozc-dictionary-tool.desktop
Created March 30, 2017 02:10
create /usr/share/applications/mozc-dictionary-tool.desktop to add a shortcut to mozc-dictionary tool (LinuxMint 18.1)
[Desktop Entry]
Name=Mozc Dictionary Tool
ENcoding=UTF-8
Exec=/usr/lib/mozc/mozc_tool --mode=dictionary_tool
Icon=/usr/share/icons/mozc/ime_product_icon_opensource-32.png
Type=Application
Terminal=false
Comment=Launch Mozc Dictionary Tool
StartupNotify=true
Categories=Settings;
@astronasutarou
astronasutarou / conkyrc
Last active April 3, 2017 00:05
.conkyrc template for LinuxMint
# .conkyrc: the original version created by fabsh <[email protected]>
# v. 1.0
# Use Xft?
use_xft yes
xftfont M+ 1p:Light:size=16
xftalpha 1.0
text_buffer_size 2048
# Update interval in seconds