Skip to content

Instantly share code, notes, and snippets.

Avatar

Naoto Yoshioka ynaoto

View GitHub Profile
@ynaoto
ynaoto / allGogoro.sh
Last active Mar 15, 2022
午後ローDBの全タイトルを放送日付きで取得する
View allGogoro.sh
#!/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 Mar 15, 2022
午後ローDBにアクセスして人気ランキング
View gogoro.sh
#!/bin/sh
API_URL="https://gogoro.api.141-lab.com/api/search?specialTitle="
names="
イーストウッド
スタローン
セガール
ヴァンダ
ニーソン
ハリソン
View gist:1b8381518df4049f13f9a5da38e1868c
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 Aug 29, 2019
ハッシュ三種(processing.py)
View hash3.py
def setup():
size(1000, 800)
background(255)
strokeWeight(3)
xmax = 1000000
ymax = 0
def p(x, y):
global ymax
View toUtf8.sh
#!/bin/sh
for f in $@
do
opt=$(LANG=C file "$f" |awk '
/Non-ISO extended-ASCII text/ {
print "-f SJIS";
next;
}
/UTF-8/ {
View a.py
# 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
View U_Tokyo2016.pde
// 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);
View bouceP5.js
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();
}
View ansi2html.sh
#!/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; }
View AlphaIsMaxRGB
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);