Skip to content

Instantly share code, notes, and snippets.

@mkyutani
mkyutani / pdf2png
Last active February 19, 2024 13:49
#!/usr/bin/env bash
CMDNAME=pdf2png
DIR=${HOME}/windownloads
if [ $# -eq 3 ]; then
PAGES="pages $2-$3"
PAGE_FIRST="-f $2"
PAGE_LAST="-l $3"
@mkyutani
mkyutani / ucconv
Last active August 10, 2023 04:13
Simple markdown converter to embedding unicode characters to text
#!/usr/bin/env -S sed -f
s/^\(\s*\)V\s*$/\1⬇️/i
s/^\(\s*\)^^\s*$/\1⬆️/
s/^\(\s*\)+/\1■/
s/^\(\s*\)--/\1⏵/
#s/^\(\s*\)-/\1✅/
s/^\(\s*\)-/\1✓/
#s/^\(\s*\)+/\1🔸/
s/\.<\./⬅️/g
s/\.>\./➡️/g
// Add your code here. All actions will run unless you explicitly skip them.
// Quick tips!
// Auto-complete is on. Start typing to see ingredient options.
// Hover over any ingredient to see the variable type and an example.
// TypeScript v2.92
let text = Twitter.newTweetByYou.Text;
let username = Twitter.newTweetByYou.UserName;
let link = Twitter.newTweetByYou.LinkToTweet;
let first_line = text.slice(0, text.search(/(\n|\r)/));
@mkyutani
mkyutani / startup-task-list.ps
Last active November 16, 2020 14:29
Complete startup task list in Windows
# startup-task-list.ps
#
# Powershell 5.1 or later
#
# $uwp: Startup tasks of Universal Windows Platform (UWP) Application
# $nuwp: Traditional 'run' and 'startup' tasks
$r = @();
$l = @("User", "System", "WoW");
$e = @("HKCU:\Software\", "HKLM:\Software\", "HKLM:\Software\Wow6432Node\");
@mkyutani
mkyutani / horn.jl
Last active August 16, 2019 01:00
My first Julia scripts
# Gabriel's Horn
# Ref. https://www.wolframalpha.com/input/?i=gabriel%27s+horn
# import Pkg; Pkg.add("Plots")
using Plots
x = [v for u in 0:2pi/100:2pi, v in 1:.01:5]
y = [cos(u)/v for u in 0:2pi/100:2pi, v in 1:.01:5]
z = [sin(u)/v for u in 0:2pi/100:2pi, v in 1:.01:5]
plot(x, y, z, title="Gabriel's horn", label="", fmt=:png)
savefig("~/tmp/horn.png")
元和元年(1615)の大坂夏の陣の後、加賀藩前田家は幕府から現在の東京大学(本郷キャンパスの一部)およびその周辺地を賜った。 寛永6年(1629)4月、前田家3代藩主利常の時に、徳川3代将軍家光・大御所秀忠の御成(訪問)があり、それに先だって豪奢な御成御殿や数寄屋を新築し、庭園を整備したと考えられる。 この庭園が育徳園であり、池を心字池といった。 夏目漱石の名作『三四郎』は、ここを舞台としたため、「三四郎池」と呼ばれるようになった。
昭和27年(1952)、地下鉄丸ノ内線御茶ノ水駅の工事の際に貝塚が発見され、調査が行われた。 ハマグリなどの貝類のほか、獣骨の破片や人骨、石斧、槌石、縄文式土器が出土した。 本郷台に入り込んでいた東京湾で魚介を採り、雑木林の獣や鳥を狩って生活していた姿がしのばれる。 現在記念碑が建っている。
享保年間(1716~1736)に、現在の本郷三丁目の交差点角に、兼康祐悦という歯科医が乳香散という歯磨き粉を売り出した。 これが当たり店が繁盛していたという。 享保15年(1730)に大火があり、湯島や本郷一帯が燃えたため、再興に力を注いだ町奉行の大岡越前守は、ここを境に南側を耐火のために土蔵造りや塗屋にすることを命じた。 一方で北側は従来どおりの板や茅ぶきの造りの町家が並んだため、「本郷もかねやすまでは江戸の内」といわれた。
江戸時代を代表する俳人松尾芭蕉(1644~1694)が、2度目の江戸入りの後、1677年から3年間この地に住んだ。 当時、旧主筋の藤堂家が神田上水の改修工事を行っていて、芭蕉はこれにたずさわり、工事現場か水番屋に住んだといわれる。 後に芭蕉を慕う人々により「龍隠庵」という家を建てたが、これが現在の芭蕉庵につながる。 その後焼失し、現在のものは第2次大戦後の建築である。
大正7年、豊島園の開園者として知られる藤田好三郎がこの地を取得し、邸宅を建設した。 大正12年、安田財閥の創始者安田善次郎の娘婿善四郎が購入し、昭和12年に長男楠雄が相続した。 建物は、伝統的な和風建築の書院造や数寄屋造を継承しながらも、内部に洋風の応接間を設けるなど、和洋折衷のスタイルも取り入れた造りである。 平成7年楠雄氏他界の後、遺族から財団法人日本ナショナルトラストに寄贈され、歴史的建造物として修復管理されている。
樋口一葉(1872~1896)が菊坂の家に住んでいたときから、生活が苦しくなるたびに
# coding: UTF-8
import sys
from selenium import webdriver
from bs4 import BeautifulSoup
url_base = "http://www.city.bunkyo.lg.jp"
driver = webdriver.PhantomJS()
def get_contents(url):
driver.get(url)
I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.
Five score years ago, a great American, in whose symbolic shadow we stand today, signed the Emancipation Proclamation. This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice. It came as a joyous daybreak to end the long night of their captivity.
But one hundred years later, the Negro still is not free. One hundred years later, the life of the Negro is still sadly crippled by the manacles of segregation and the chains of discrimination. One hundred years later, the Negro lives on a lonely island of poverty in the midst of a vast ocean of material prosperity. One hundred years later, the Negro is still languished in the corners of American society and finds himself an exile in his own land. And so we've come here today to dramatize a shameful condition.
In a sense we've come to our nation
[{"id":"7f2f030e.ba7c14","type":"inject","z":"69f50d6e.27d11c","name":"","topic":"","payload":"Is it cloudy today?","payloadType":"string","repeat":"","crontab":"","once":true,"x":127,"y":154,"wires":[["db86397f.5a46f"]]},{"id":"22108696.9cfe6a","type":"debug","z":"69f50d6e.27d11c","name":"","active":true,"console":"false","complete":"false","x":542,"y":338,"wires":[]},{"id":"db86397f.5a46f","type":"natural-language-classifier","z":"69f50d6e.27d11c","name":"","username":"9b9e911b-538d-4d4a-8f11-5e185e69cca0","password":"qMicYuKpxs6s","classifierid":"3B015Fx14-nlc-2340","x":364,"y":252,"wires":[["22108696.9cfe6a"]]}]
@mkyutani
mkyutani / piflow.json
Last active December 16, 2015 00:04
Sample of the IBM Watson Personality Insights with Node-RED
[
{
"wires": [
[
"a007a948.20f6a"
]
],
"y": 38.00000762939453,
"id": "9de62461.aaae7",
"type": "http in",