Skip to content

Instantly share code, notes, and snippets.

View terkel's full-sized avatar

Takeru Suzuki terkel

View GitHub Profile
@terkel
terkel / clearfix.css
Last active October 24, 2022 07:46
Clearfix
/* http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
@terkel
terkel / _clearfix.scss
Last active September 25, 2015 06:57
_clearfix.scss
// http://nicolasgallagher.com/micro-clearfix-hack/
$support-ie: 8 !default;
@mixin clearfix {
@if $support-ie and $support-ie != 0 and $support-ie < 8 {
*zoom: 1;
}
&:before,
&:after {
content: " ";
display: table;
@terkel
terkel / _grids.scss
Created April 8, 2011 14:03
Sass module like YUI CSS Grids
// _grids.scss
$gridWidth: 100%;
$colGap: 0;
@mixin grid () {
display: table;
width: $gridWidth + $colGap;
@if $colGap > 0 {
margin-right: - $colGap;
@terkel
terkel / jquery.kome.js
Created May 6, 2011 12:10
米印 (※) を検出
(function ($) {
$.fn.kome = function () {
var regex = /^[\s\u3000]*(\u203B)[\s\u3000]*/;
return this.each(function () {
var $this = $(this),
html = $this.html().replace(regex, '<span class="kome">$1</span>');
$this.html(html);
});
};
})(jQuery);
@terkel
terkel / reset.css
Created May 15, 2011 16:47
CSS Reset
* {
padding: 0;
margin: 0;
}
html {
overflow-y: scroll;
font: small; /* for IE6 in quirks mode */
}
body {
font-size: 100%;
@terkel
terkel / jquery.dropdown.js
Created May 18, 2011 09:41
jQuery Dropdown plugin
// jQuery Dropdown plugin
(function ($) {
$.fn.dropdown = function (options) {
var opts = $.extend({
child: 'ul:first',
hoverClass: 'hover',
showTimeout: 100,
showSpeed: 200,
hideTimeout: 200,
hideSpeed: 100
@terkel
terkel / jquery.ua.js
Created June 12, 2011 14:48
jQuery User-Agent Detection Plugin
// See https://github.com/terkel/jquery-ua
@terkel
terkel / jquery.toggleHoverClass.js
Created July 11, 2011 06:53
jQuery Toggle Hover Class Plugin
// jQuery Toggle Hover Class Plugin
(function ($) {
$.fn.toggleHoverClass = function () {
return this.each(function () {
var $this = $(this),
c = this.className,
originalClasses = c? c.split(' '): [],
hoverClasses = [],
hoverClass = 'hover',
len = originalClasses.length,
@terkel
terkel / gist:1077264
Created July 12, 2011 02:09
addClass()
function addClass (elem, classes) {
var c = elem.className;
elem.className = c? c + ' ' + classes: classes;
}
@terkel
terkel / the-quick-brown-fox-ja.html
Created September 20, 2011 09:49
The quick brown fox text
あのイーハトーヴォのすきとおった風、<br>
夏でも底に冷たさをもつ青いそら、<br>
うつくしい森で飾られたモリーオ市、<br>
郊外のぎらぎらひかる草の波。<br>
祇辻飴葛蛸鯖鰯噌庖箸