This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
API_URL="https://gogoro.api.141-lab.com/api/search?specialTitle=" | |
names=" | |
イーストウッド | |
スタローン | |
セガール | |
ヴァンダ | |
ニーソン | |
ハリソン |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup(): | |
size(1000, 800) | |
background(255) | |
strokeWeight(3) | |
xmax = 1000000 | |
ymax = 0 | |
def p(x, y): | |
global ymax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for f in $@ | |
do | |
opt=$(LANG=C file "$f" |awk ' | |
/Non-ISO extended-ASCII text/ { | |
print "-f SJIS"; | |
next; | |
} | |
/UTF-8/ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
NewerOlder