Skip to content

Instantly share code, notes, and snippets.

View butchi's full-sized avatar

IWABUCHI Yu(u)ki (butchi) butchi

View GitHub Profile
<!DOCTYPE html>
<html lang="ja">
<head></head>
<body>
<div class="elm-1" lang="en">
<p>Thanks, world!</p>
</div>
<div class="elm-2" lang="ja">
<p>ありがとう世界!</p>
</div>
@butchi
butchi / file5.js
Created October 22, 2015 09:23
jQueryのAjaxでJavaScriptファイルを取得するときの罠 ref: http://qiita.com/butchi_y/items/02f4ffd3b51055bcf536
httpData: function( r, type ) {
var ct = r.getResponseHeader("content-type");
var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
var data = xml ? r.responseXML : r.responseText;
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
// If the type is "script", eval it in global context
if ( type == "script" )
@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;
}
@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 / 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.txt
Last active December 15, 2015 21:46
Mathematicaのわかりやすいイントロダクション 〜導入編〜 ref: http://qiita.com/butchi_y/items/a00a4da881e3677345cc
Sin[Pi/4]
@butchi
butchi / file0.txt
Last active December 15, 2015 21:49
Mathematicaでマンデルブロー集合 ref: http://qiita.com/butchi_y/items/16786dfd199657160e0c
MandelbrotSetPlot[]
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:50
Mathematicaで星形を書くよ☆ ref: http://qiita.com/butchi_y/items/b648a4c33f8112bb7c37
(-1)^Range[0, 4, 4/5]
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True, AspectRatio -> Automatic]
@butchi
butchi / file1.js
Last active December 13, 2015 13:36
ES2015時代のFizzBuzzに挑戦する ref: http://qiita.com/butchi_y/items/59d45e8212643b43cba4
Array(100)