Skip to content

Instantly share code, notes, and snippets.

View butchi's full-sized avatar

IWABUCHI Yu(u)ki (butchi) butchi

View GitHub Profile
@butchi
butchi / file0.txt
Last active December 15, 2015 21:52
シェルピンスキーのカーペット(Mathematicaショートフラクタルシリーズ) ref: http://qiita.com/butchi_y/items/3b164bb8e25dad7763cc
sierpinskiCarpet[x_] := ArrayFlatten[x /. {
0 -> {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}
},
1 -> {
{1, 1, 1},
{1, 0, 1},
{1, 1, 1}
@butchi
butchi / file0.txt
Last active December 15, 2015 21:52
シェルピンスキーのギャスケット(Mathematicaショートフラクタルシリーズ) ref: http://qiita.com/butchi_y/items/fbf5d2b9b49c10c8f217
Graphics@Polygon[Transpose[{Re[#], Im[#]}] & /@
Nest[
Flatten[{#/2, #/2 + 1/4 + Sqrt[3]/4 I, #/2 + 1/2}, 1] &,
{{0, 1/2 + Sqrt[3]/2 I, 1}},
6
]
]
@butchi
butchi / file1.js
Last active December 13, 2015 13:36
ES2015時代のFizzBuzzに挑戦する ref: http://qiita.com/butchi_y/items/59d45e8212643b43cba4
Array(100)
@butchi
butchi / file0.txt
Last active December 15, 2015 21:50
Mathematicaで星形を書くよ☆ ref: http://qiita.com/butchi_y/items/b648a4c33f8112bb7c37
(-1)^Range[0, 4, 4/5]
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True, AspectRatio -> Automatic]
listPts = Table[{Cos[a Pi], Sin[a Pi]}, {a, 0, 4, 4/5}]
ListLinePlot[listPts, AspectRatio -> Automatic]
@butchi
butchi / file0.txt
Last active December 15, 2015 21:49
Mathematicaでマンデルブロー集合 ref: http://qiita.com/butchi_y/items/16786dfd199657160e0c
MandelbrotSetPlot[]
@butchi
butchi / file0.txt
Last active December 15, 2015 21:46
Mathematicaのわかりやすいイントロダクション 〜導入編〜 ref: http://qiita.com/butchi_y/items/a00a4da881e3677345cc
Sin[Pi/4]
@butchi
butchi / file2.js
Created November 27, 2015 11:10
Functionによるevalの代替 ref: http://qiita.com/butchi_y/items/d6024f81a9eda826fea0
mathEval("pow(2, 10), alert('あぶない!')")();
@butchi
butchi / file0.css
Created November 25, 2015 11:45
カスタムUIのチェックボックス・ラジオボタン ref: http://qiita.com/butchi_y/items/936eff265e45c6a2165d
body {
background-color: #fff;
}
input[type="checkbox"],
input[type="radio"] {
position: absolute;
width: 0;
height: 0;
top: 0;
@butchi
butchi / file0.js
Last active October 27, 2015 08:04
JavaScriptのランプ関数いろいろ ref: http://qiita.com/butchi_y/items/36978607f95f8e5ccf91
function ramp(x) {
return (x < 0) ? 0 : x;
}