Skip to content

Instantly share code, notes, and snippets.

View ynaoto's full-sized avatar

Naoto Yoshioka ynaoto

View GitHub Profile
@ynaoto
ynaoto / allGogoro.sh
Last active March 15, 2022 17:00
午後ローDBの全タイトルを放送日付きで取得する
#!/bin/sh
API_URL="https://gogoro.api.141-lab.com/api/search"
yearFrom=1996
yearTo=$(date "+%Y")
awk -v y0=$yearFrom -v y1=$yearTo '
BEGIN {
for (y = y0; y <= y1; y++) {
printf("%4d\n", y);
}
@ynaoto
ynaoto / gogoro.sh
Last active March 15, 2022 09:20
午後ローDBにアクセスして人気ランキング
#!/bin/sh
API_URL="https://gogoro.api.141-lab.com/api/search?specialTitle="
names="
イーストウッド
スタローン
セガール
ヴァンダ
ニーソン
ハリソン
git lfs uninstall
rm .gitattrubutes
git add .gitattrubutes
git lfs ls-files | sed 's/^............ //' | while read f; do
git lfs migrate export --yes --everything --include "$f";
done
@ynaoto
ynaoto / hash3.py
Last active August 29, 2019 17:42
ハッシュ三種(processing.py)
def setup():
size(1000, 800)
background(255)
strokeWeight(3)
xmax = 1000000
ymax = 0
def p(x, y):
global ymax
@ynaoto
ynaoto / gist:5228280
Last active June 21, 2017 07:23
Install 'mosh' to CentOS 6
rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install mosh –enablerepo=epel
#!/bin/sh
for f in $@
do
opt=$(LANG=C file "$f" |awk '
/Non-ISO extended-ASCII text/ {
print "-f SJIS";
next;
}
/UTF-8/ {
@ynaoto
ynaoto / a.py
Created December 27, 2016 05:26
# https://twitter.com/nanaio627/status/813413642439835649
import sys
def diff(a):
b = []
for i in range(len(a)-1):
b.append(a[i+1]-a[i])
return b
// http://qiita.com/massa142/items/3285a1b1ed12a6ab0299
void setup() {
size(500, 500);
}
void plot() {
float x = random(-2, 2);
float y = random(-2, 2);
PVector P = new PVector(x, y);
@ynaoto
ynaoto / bouceP5.js
Last active September 12, 2016 01:26
var h = 575; // x vertex, half of total bounce duration
var k = 160; // y vertex, total bounce height
var a = -4 * k / Math.pow(h * 2, 2); // coefficient: -.000483932
var ypos, start, time;
function setup() {
createCanvas(66, 226);
fill('#EC245E');
noStroke();
}
#!/bin/sh
cat <<EOF
<!DOCTYPE html>
<meta charset="UTF-8">
<title>ansi to html</title>
<style>
body { font-family: menlo; }
.e1m { font-weight: bold; }
.e4m { text-decoration: underline; }