Skip to content

Instantly share code, notes, and snippets.

View terkel's full-sized avatar

Takeru Suzuki terkel

View GitHub Profile
@terkel
terkel / _jis-z-8102-2001-ja.scss
Created December 18, 2011 09:34
JIS慣用色名 (ja)
// http://ja.wikipedia.org/wiki/JIS%E6%85%A3%E7%94%A8%E8%89%B2%E5%90%8D
$toki: #F9A1D0; // 鴇色 ときいろ
$tsutsuji: #CB4B94; // 躑躅色 つつじいろ
$sakura: #FFDBED; // 桜色 さくらいろ
$bara: #D34778; // 薔薇色 ばらいろ
$karakurenai: #E3557F; // 韓紅 からくれない
$sango: #FF87A0; // 珊瑚色 さんごいろ
$kobai: #E08899; // 紅梅色 こうばいいろ
$momo: #E38698; // 桃色 ももいろ
@terkel
terkel / jquery.lazyload.js
Created December 26, 2011 10:06
jQuery Lazy Load plugin
/*!
* jQuery Lazy Load plugin v0.9.2
* https://gist.github.com/1520842
*
* Copyright (c) 2012 Takeru Suzuki - http://terkel.jp/
* Licensed under the MIT license - http://www.opensource.org/licenses/MIT
*/
(function (window, $) {
$.fn.lazyLoad = function (options) {
// http://www.culture27.com/blog/2011/12/font-family
$gothic: "Hiragino Kaku Gothic ProN", "Meiryo", "MS PGothic";
$mincho: "Hiragino Mincho ProN", "MS PMincho";
@terkel
terkel / jquery.shuffle.js
Created January 11, 2012 05:31
jQuery Shuffle plugin
// jQuery Shuffle plugin, https://gist.github.com/1593214
// see http://www.fumiononaka.com/TechNotes/Flash/FN0212002.html
(function ($) {
$.fn.shuffle = function () {
var i = this.length,
j,
t;
while (i){
j = Math.floor(Math.random()*i);
@terkel
terkel / gist:1598169
Created January 12, 2012 02:21
regexp for valid e-mail address per HTML5 spec
// http://html5.org/r/6884
/^[a-zA-Z0-9.!#$%&'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
@terkel
terkel / gist:1681150
Last active September 29, 2015 22:48
Detect IE and add classes to the <html> element
// Detect IE versions
// https://gist.github.com/527683
var ie = (function () {
var v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
do {
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->';
} while (all[0]);
return (v > 4)? v: void 0;
@terkel
terkel / sticky-footer.html
Last active September 30, 2015 01:07
CSS Sticky Footer
@terkel
terkel / gist:1784889
Created February 10, 2012 00:51
CSS line break
.br-before:before,
.br-after:after {
content: "\A";
white-space: pre-line;
}
@terkel
terkel / colorbox.html
Last active October 1, 2015 06:38
HTML generated by ColorBox
<div id="cboxOverlay"></div>
<div id="colorbox">
<div id="cboxWrapper">
<div>
<div id="cboxTopLeft" style="float: left;"></div>
<div id="cboxTopCenter" style="float: left;"></div>
<div id="cboxTopRight" style="float: left;"></div>
</div>
<div style="clear: left;">
<div id="cboxMiddleLeft" style="float: left;"></div>
@terkel
terkel / jquery.parallax.js
Created March 12, 2012 08:16
jQuery Parallax Effect plugin
/*!
* jQuery Parallax Effect plugin v0.9
* https://gist.github.com/2020675
*
* Copyright (c) 2012 Takeru Suzuki - http://terkel.jp/
* Licensed under the MIT license - http://www.opensource.org/licenses/MIT
*/
(function (window, $) {
$.fn.parallax = function (options) {