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
#!/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; }
background(255, 0, 0);
PImage img = loadImage("179033_486608097723_1903922_n.jpg");
img.loadPixels();
int n = img.width * img.height;
for (int i = 0; i < n; i++) {
color c = img.pixels[i];
float a = alpha(c);
float r = red(c);
float g = green(c);
float b = blue(c);