Skip to content

Instantly share code, notes, and snippets.

View baikamo's full-sized avatar

Baikamo baikamo

  • Japan
View GitHub Profile
@baikamo
baikamo / bubble.es6
Last active October 10, 2016 10:15
es6 + SVG でギザギザなフキダシをつくる。
const SvgNS = 'http://www.w3.org/2000/svg';
const init = () => {
let g = document.getElementById('SVG');
g.appendChild( noisyBubble(200, 200, 200, 100) );
};
// 標準でzipWith関数ほしい
const zipWith = (l1, l2) =>
Array(Math.max(l1.length, l2.length))
@baikamo
baikamo / combos.html
Created July 8, 2016 13:18
あるコンボボックス(select要素)の選択項目を変更すると、別のコンボボックスの項目が変更されるやつ。 ref: http://qiita.com/sarasavatei/items/e175148dff2451cd5003
<!DOCTYPE html>
<html lang='ja'>
<head>
<meta charset='utf-8'>
<style>
div{margin: 1em;}
select{padding: 1em;}
</style>
<script src='combos.js'></script>
</head>
@baikamo
baikamo / dnd.html
Last active October 10, 2016 10:15
HTML5+jsで、ある子要素を別の親要素の下へとドラッグで移動させる。
<!DOCTYPE html>
<html lang='ja'>
<head>
<meta charset='utf-8'>
<style>
.card {
width: 80px;
height: 80px;
background: #616161;
border-radius: 4px;
@baikamo
baikamo / drilldown.html
Created March 16, 2016 14:14
selectboxのドリルダウン
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
let onToggled = function(target) {
let f = function(e){
let cls = $(e.target).find(':selected').data('class');
$(target).val(null);
@baikamo
baikamo / gist:1e5a82367a1193c3fc3f
Created November 26, 2014 08:06
行間の列検索
list = [[0, 1, 2],[3, 4, 5], [6, 7, 8]]
def vsearch(num, col):
return num in [list[x][col] for x in range(len(list[0]))]