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 / twindragon.js
Created December 23, 2015 13:08
ツインドラゴンに関する発見と実装 ref: http://qiita.com/butchi_y/items/4f0bd72f4b322d4943b6
var i, j;
var x = [0];
var y = [0];
var nextX = [];
var nextY = [];
for(j=0; j<4; j++) {
l = x.length-1;
for(i=0; i<x.length; i++) {
nextX[i] = x[i] + 1 - y[l];
nextY[i] = y[i] + x[l];
@butchi
butchi / file0.html
Last active August 25, 2017 06:49
ソーシャルボタンまとめ ref: http://qiita.com/butchi_y/items/b365dc7ac4739ac9c74d
<a href="https://twitter.com/share" class="twitter-share-button" data-text="(ここにツイート文言を入れる。data-text属性ごと省けばページタイトルがツイート文言になる)" data-lang="ja">ツイート</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
@butchi
butchi / primality_test_by_digital_root.js
Created June 3, 2016 12:51
素数判定(37まで)
function isPrime(n) {
var ret = true;
for(let i = 2; i < n - 1; i++) {
if(isMultiple(n, i)) {
ret = false;
}
}
return ret;
}
@butchi
butchi / index.html
Last active November 8, 2016 03:10
JSだけでソーシャルボタン設置 ref: http://qiita.com/butchi_y/items/f2253ddd504d30686f62
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>JS share button</title>
<meta property="og:title" content="XHTML like">
<meta property="og:type" content="website">
<meta property="og:url" content="http://example.com/">
@butchi
butchi / es5.js
Created November 9, 2016 09:31
2次元配列の初期化(ES2015) ref: http://qiita.com/butchi_y/items/db3078dced4592872a9c
var x, y;
var tbl = new Array(3);
for(y = 0; y < 3; y++) {
tbl[y] = new Array(3);
for(x = 0; x < 3; x++) {
tbl[y][x] = 0;
}
}
<!DOCTYPE html><title>Hello, world!</title><style>head,title{display:block}
[
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
$ yarn
yarn install v0.17.8
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning [email protected]: Babel's CLI commands have been moved from the babel package to the babel-cli package
warning debowerify > bower > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning browser-sync > resp-modifier > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning debowerify > bower > bower-config > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning debowerify > bower > insight > [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
warning debowerify > bower > request > [email protected]: use uuid module instead
@butchi
butchi / hilight-table.nb
Last active December 1, 2016 14:34
Mathematicaで数表のハイライト ref: http://qiita.com/butchi_y/items/40123394f9acd32c288f
highlightTable[tbl_, crit_, color_: Red] :=
Grid[tbl] /. {n_?crit -> Item[n, Background -> color]}
@butchi
butchi / blur.nb
Created December 3, 2016 14:42
SoundNoteをPlayで再実装してきよしこの夜を鳴らす ref: http://qiita.com/butchi_y/items/d8b85aa3e13a835a33fa
sound[{SoundNote[7], SoundNote[7], SoundNote[7], SoundNote[3, 4]}, 1.5]