Skip to content

Instantly share code, notes, and snippets.

@kujirahand
kujirahand / exec-rhino
Last active August 29, 2015 13:56
Rhino/JavaScriptをMacアプリに仕上げる方法 ref: http://qiita.com/kujirahand/items/5a327970e0d0b60be14a
on main(input)
-- スクリプトの名前
set mainScript to "test.sh"
-- 親ディレクトリの取得
tell application "Finder" to set parentDirPos to parent of (path to me) as text
set parentDir to ((alias parentDirPos)'s POSIX path)
try
do shell script "cd " & parentDir & ";./" & mainScript & space & input
end try
end main
@kujirahand
kujirahand / bbs.go
Last active June 8, 2022 16:52
100行位内、標準ライブラリ以外使わないを目標にして作った掲示板
package main
import (
"encoding/json"
"fmt"
"html"
"io/ioutil"
"net/http"
"time"
)
@kujirahand
kujirahand / parser.go.y
Created June 4, 2020 11:09
goyaccの一番簡単なサンプル
%{
// プログラムのヘッダを指定
package main
import (
"os"
"fmt"
)
%}
%union {
num int
<!DOCTYPE html><html><meta charset="utf-8"><body>
<!-- 入力と出力のテキストボックスを作る -->
<h3>入力 - 以下にタイトルとURLの一覧を貼り付け</h3>
<textarea id="in_ta" rows="8" cols="80">
オンライン結婚式場見学を開始したノバレーゼの成約に向けた取組
https://news.mynavi.jp/article/20200619-1056453/
Windows 10にUbuntu 20.04 LTSをインストールする
https://news.mynavi.jp/article/liunx_win-51/
ノートPCと周辺機器の連係が一気に楽になる「ドッキングステーション」
https://news.mynavi.jp/kikaku/beginner_pc-3/
<!DOCTYPE html><html><meta charset="utf-8"><body>
<style>
textarea {
font-family: "Courier New", Consolas, monospace;
background-color: #f0ffff;
}
</style>
<!-- 入力と出力のテキストボックスを作る -->
<h3>入力 - 以下にタイトルとURLの一覧を貼り付け</h3>
<textarea id="in_ta" rows="8" cols="80">
@kujirahand
kujirahand / data.csv
Created July 9, 2020 01:49
2010年から10年分の日別平均気温・最高気温のCSVファイル
年月日 平均気温(℃) 最高気温(℃)
2010/1/1 4.8 9.5
2010/1/2 6.3 11.4
2010/1/3 5.7 9.2
2010/1/4 6.5 9.6
2010/1/5 7.3 13.2
2010/1/6 6.5 10.4
2010/1/7 7.3 12.1
2010/1/8 7.6 11.3
2010/1/9 7.2 11.1
@kujirahand
kujirahand / parser.go.y
Last active January 25, 2022 01:29
複数行の計算、および、変数代入の機能がある最小計算言語
%{
// プログラムのヘッダを指定
package main
import (
"os"
"fmt"
"strconv"
"bufio"
)
%}
package main
import (
"bytes"
"encoding/binary"
"io"
"io/ioutil"
)
// 手軽にnバイト読み込む関数を定義
@kujirahand
kujirahand / population-tokyo-2015.csv
Last active April 29, 2022 10:55
population-tokyo-2015
西暦(年) 人口(総数) 人口(男) 人口(女)
1920年 3699428 1952989 1746439
1925年 4485144 2387609 2097535
1930年 5408678 2855323 2553355
1935年 6369919 3325696 3044223
1940年 7346983 3790831 3556152
1945年 3488284 1788145 1700139
1950年 6277500 3169389 3108111
1955年 8037084 4115823 3921261
1960年 9683802 4997023 4686779
@kujirahand
kujirahand / setup-echo-server.sh
Last active May 21, 2021 14:13
ColabになでしこWebSocket Echoサーバーを構築するコマンド
#!/bin/bash
# ColabになでしこWebSocketサーバを自動構築するスクリプト
# Colab
# [URL] https://colab.research.google.com/
# 以下のコマンドをColabで実行してください。
# => !curl "https://n3s.nadesi.com/index.php?action=plain&page=546" > setup.sh && /bin/bash ./setup.sh
echo "なでしこをインストールしています"
npm install -g nadesiko3
npm install nadesiko3-websocket