Skip to content

Instantly share code, notes, and snippets.

# transitionEnd event name detection from Modernizr
# http://modernizr.com/docs/
transEndEventName = do ->
names =
WebkitTransition: "webkitTransitionEnd"
MozTransition: "transitionend"
OTransition: "oTransitionEnd"
msTransition: "MSTransitionEnd"
transition: "transitionend"
@Takazudo
Takazudo / sessionStorage.js
Created June 8, 2012 08:46 — forked from tagawa/sessionStorage.js
sessionStorage polyfill
/*
* Based on: http://www.quirksmode.org/js/cookies.html
* and https://github.com/wojodesign/local-storage-js/blob/master/storage.js
* and https://gist.github.com/350433
* License: http://www.opensource.org/licenses/MIT
*/
(function(window) {
'use strict';
window.sessionStorage = window.sessionStorage || {
@Takazudo
Takazudo / excerpt.rb
Created April 10, 2012 18:01 — forked from stympy/excerpt.rb
Jekyll excerpt plugin
# This goes in _plugins/excerpt.rb
module Jekyll
class Post
alias_method :original_to_liquid, :to_liquid
def to_liquid
original_to_liquid.deep_merge({
'excerpt' => content.match('<!--more-->') ? content.split('<!--more-->').first : nil
})
end
end
@Takazudo
Takazudo / gfm.rb
Created March 27, 2012 15:25 — forked from peterhellberg/gfm.rb
GitHub Flavored Markdown parser for use with Jekyll and Marked.app
#!/usr/bin/env ruby
require 'rubygems'
require 'redcarpet'
require 'pygments.rb'
class HTMLwithPygments < Redcarpet::Render::HTML
def block_code(code, language)
Pygments.highlight(code, :lexer => language.to_sym, :options => {
:encoding => 'utf-8'
})
@Takazudo
Takazudo / css3-property-duplicate
Created February 24, 2012 12:10 — forked from edom18/css3-property-duplicate
CSSのプロパティを、ベンダープレフィクス付きで複製するスクリプト。(インデントも引き継ぐよう修正)
function! CSS3PropertyDuplicate()
let reg_save = @@
silent normal Y
let css3 = @@
let ind = matchlist(css3, '\v(\s*)(.*)')
let webkit = ind[1] . "-webkit-" . ind[2]
let moz = ind[1] . "-moz-" . ind[2]
let ms = ind[1] . "-ms-" . ind[2]
let o = ind[1] . "-o-" . ind[2]
@Takazudo
Takazudo / css3-property-duplicate
Created May 15, 2011 02:20 — forked from edom18/css3-property-duplicate
CSSのプロパティを、ベンダープレフィクス付きで複製するスクリプト。(インデントも引き継ぐよう修正)
function! CSS3PropertyDuplicate()
let reg_save = @@
silent normal Y
let css3 = @@
let ind = matchlist(css3, '\v(\s*)(.*)')
let webkit = ind[1] . "-webkit-" . ind[2]
let moz = ind[1] . "-moz-" . ind[2]
let ms = ind[1] . "-ms-" . ind[2]
let o = ind[1] . "-o-" . ind[2]
@Takazudo
Takazudo / kotaroclearfix.css
Created May 13, 2011 01:55 — forked from kotarok/my clearfix
the clearfix I'm currently using
/* kotaroclearfix */
.clearfix { *zoom: 1; }
.clearfix:after { content: ''; display: block; clear : both; height: 0; }
@media print { .clearfix:after { height: 1px; margin-bottom: -1px; visibility: hidden; } }
<!--
see http://www.modernizr.com/docs/#backgroundsize
-->
<script src="modernizr-1.7.min.js"></script>