Skip to content

Instantly share code, notes, and snippets.

@Yarakashi-Kikohshi
Yarakashi-Kikohshi / latex-physics.md
Created February 9, 2021 07:36
physics パッケージを自分好みに

physics パッケージを自分好みに

physics パッケージは物理で用いられる数学記号等を簡便に利用できるようにxparse パッケージを利用してコマンドを作成している.また,amsmath パッケージにも依存している.

physics.sty | CTAN

目的

# from https://youtu.be/7bwK9tsdve4
import curses
import time
screen = curses.initscr()
dims = screen.getmaxyx()
for z in range(dims[1]-12):
screen.clear()
screen.addstr(dims[0]/2, z, "Hello World!")
screen.refresh()
time.sleep(0.05)
@koyopro
koyopro / amazon-calc.min.js
Last active December 20, 2023 05:52
Amazonで一年間に使った金額と、注文履歴のTSVを出力するブックマークレット【2015年版】( https://gist.github.com/yoshida-k/a480a45712ccf1bf239c ) のminify
javascript:(function()%7Bfunction%20t(t)%7Bconsole.log(t);t.date.match(e);var%20n=RegExp.$1;var%20r=RegExp.$2;if(r.length%3C=1)r=%220%22+r;var%20i=RegExp.$3;if(i.length%3C=1)i=%220%22+i;var%20s=%22%22+n+%22/%22+r+%22/%22+i;var%20o=%5Bs,t.name,t.author,t.url%5D;return%20o.join(%22%5Ct%22)+%22%5Cn%22%7Dfunction%20n(e)%7Bvar%20t=window.open(%22%22,%22name%22,%22height=250,width=700%22);t.document.write(%22%3Chtml%3E%3Chead%3E%3Ctitle%3EAmazon%20to%20TSV%3C/title%3E%22);t.document.write(%22%3C/head%3E%3Cbody%3E%22);t.document.write(%22%3Cpre%3E%22);t.document.write(e);t.document.write(%22%3C/pre%3E%22);t.document.write(%22%3C/body%3E%3C/html%3E%22);t.document.close();return%20t%7Dfunction%20u(e)%7Bif(typeof%20e!==%22number%22)%7Bvar%20e=0;$(%22%3Cdiv/%3E%22).css(%7Bposition:%22fixed%22,left:0,top:0,width:%22100%25%22,height:%22100%25%22,zIndex:1e3,backgroundColor:%22rgba(0,0,0,.7)%22,color:%22%23fff%22,fontSize:30,textAlign:%22center%22,paddingTop:%2215em%22%7D).attr(%22id%22,%22___overlay%22).text(%22Amazon%E3%8
@bouzuya
bouzuya / header.tex
Last active February 15, 2020 03:48
Pandoc で Markdown から PDF へ変換
%\usepackage{luatexja}
\setmainfont{TakaoPMincho}
\setsansfont{TakaoPGothic}
\setmonofont{TakaoGothic}
@esehara
esehara / 1.1.1.markdown
Last active March 3, 2019 18:37
『計算機プログラムの構造と解釈』一章一節読書メモ

普通の四則演算として考えると次のように表せる。

1 + 2 * 3 + 4 / 2

これは、下のようにまとめることが可能だ。

1 + (2 * 3) + (4 / 2)
@uchida
uchida / Tweaks.rst
Last active January 1, 2021 04:35
Sphinx と LaTeX を使うときの 小技

Sphinx と LaTeX を使うときの 小技

著者:打田 旭宏
ライセンス:CC-BY 3.0
更新日時:|time|

Sphinx の LaTeX 出力を利用するときに見栄えを凝るのに知っておくとよいかもしれない小技をまとめました。

@BekeJ
BekeJ / py2tex.py
Last active March 9, 2017 06:41
IPython notebook py2tex
"""
Module for IPython to display code with TeX representation.
This makes for example the following workflow possible:
.. sourcecode:: ipython
In [1]: %load_ext py2tex
In [2]: from math import *
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@xianyi
xianyi / as
Created June 20, 2012 02:39
Replace the native OS X assembler (/usr/bin/as) by a script which calls the clang assembler. (http://old.nabble.com/Re%3a-gcc,-as,-AVX,-binutils-and-MacOS-X-10.7-p32584737.html)
#!/bin/sh
HAS_INPUT_FILE=0
ARGS=$@
while [ $# -ne 0 ]; do
ARG=$1
# Skip options
if [ $ARG == "-arch" ] || [ $ARG == "-o" ]; then
# Skip next token
shift
shift
@esle
esle / dot.py
Created February 20, 2012 06:08
dot directive for reStructuredText, with this you can write ..dot:: things
"""
dot directive (require graphviz)
"""
from docutils import nodes
from docutils.parsers.rst import directives, Directive
import subprocess as sp
nthUnnamed = 0