Skip to content

Instantly share code, notes, and snippets.

View hekt's full-sized avatar
🗼

Kazutoshi Horie hekt

🗼
View GitHub Profile
@hekt
hekt / tweet_button.css
Created February 23, 2012 10:49
pure css tweet button
/*
* Pure CSS Tweet Button
*/
#tweet_button span {
display: inline-block;
}
#tweet_button .wrap {
position: relative;
font-family: "Arial", sans-serif;
@hekt
hekt / gist:1755984
Created February 6, 2012 23:51
zip individual files/folders
#! /bin/bash
for f in "$@"
do
cd "${f%/*}"
zip -r "${f##*/}" "${f##*/}"
done
@hekt
hekt / gist:1755965
Created February 6, 2012 23:47
remove too many args from google search url
(function() {
url = location.href;
window.prompt('Clean URL', url.match(/^.+?\?/) + url.match(/q=.*?(?=&)/));
})();
// javascript:(function(){var%20u=location.href;window.prompt('Clean%20URL',u.match(/^.+?\?/)+u.match(/q=.*?(?=&)/))})();
@hekt
hekt / regex_css
Created August 14, 2011 16:59
RegEx for parsing CSS
(# comment )
(/\*(?:(?!\*/)[\s\S])*\*/)
(/\*(?:[^*]|\*[^/])*\*/)
(# @keyframes-rule )
(@(?:-webkit-|-moz-)?keyframes(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)+[a-zA-Z0-9_\-]+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*(?:(?:from|to|[0-9]{1,3}%)(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[^{}"']|/\*(?:(?!\*/)[\s\S])*\*/|'[^']*'|"[^"]*")*}(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*)+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*})
(# ruleset )
((?:[^{}"']|'[^']*'|"[^"]*")+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[^{}"']|/\*(?:(?!\*/)[\s\S])*\*/|'[^']*'|"[^"]*")*})