Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Takazudo / randomPick.js
Created October 29, 2011 10:27
randomPick/randomNum
/* need underscore.js */
/**
* randomNum
* randomNum(3,6); => 4
*/
var randomNum = function(from, to) {
return from + Math.floor( Math.random() * (to - from + 1) );
};
@Takazudo
Takazudo / fiddle.css
Created September 13, 2011 17:58
shorten URL using bit.ly API (dirty)
We couldn’t find that file to show.
@Takazudo
Takazudo / fiddle.css
Created September 13, 2011 17:21
shortenUrl using bit.ly API
We couldn’t find that file to show.
@Takazudo
Takazudo / gist:1203265
Created September 8, 2011 12:22
測地系変換
/* 測地系変換 */
function convertLatLng(params){
var x = params.x / 60 / 60;
var y = params.y / 60 / 60;
y = y - y * 0.00010695 + x * 0.000017464 + 0.0046017;
x = x - y * 0.000046038 - x * 0.000083043 + 0.010040;
return {
lat: y,
lng: x
@Takazudo
Takazudo / fiddle.css
Created September 3, 2011 21:02
designPattern example - factory
*{
margin:0;
padding:0;
}
body{
padding:30px;
}
.face{
border:1px solid #000;
position:relative;
@Takazudo
Takazudo / fiddle.css
Created September 3, 2011 20:39
designPattern ex: flyweight
*{
margin:0;
padding:0;
}
.balloon{
position:absolute;
left:0;
top:0;
padding:.5em .8em;
background:#000;
@Takazudo
Takazudo / fiddle.css
Created August 26, 2011 12:39
$.fn.initFbComments
.mod-fbcomments{
float:left;
margin:5px;
}
@Takazudo
Takazudo / fiddle.css
Created August 22, 2011 11:54
$.fn.autoSwap
.js .alt{
display:none;
}
.test{
border:1px solid #000;
margin:0 0 10px;
padding:10px;
}
@Takazudo
Takazudo / fiddle.css
Created August 22, 2011 10:37
$.fn.connectLinkStat
a:hover,
a:focus,
a.state-hover{
background:#a00;
color:#fff;
}
a:active,
a.state-active{
background:#f00;
color:#fff;
We couldn’t find that file to show.