Skip to content

Instantly share code, notes, and snippets.

View hekt's full-sized avatar
🗼

Kazutoshi Horie hekt

🗼
View GitHub Profile
@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])*\*/|'[^']*'|"[^"]*")*})
@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 / 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 / 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 / md-result-styling.el
Created March 5, 2012 07:54
emacs keyboard macro for styling markdown html
;; <!-- elem attr="val" -->
;;
;; <elem>
;; => <elem attr="val">
;; <!-- section -->, <!-- /section -->
;; => <section>, </section>
;; <pre[ attr="val"]><code>, </code></pre>
;; => <pre[ attr="val"]>, </pre>
@hekt
hekt / shBrushMarkdown.js
Created March 5, 2012 17:38
Markdown brush for SyntaxHighlighter
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
@hekt
hekt / markdown.nanorc
Created March 5, 2012 19:27
Markdown syntax highlighting in GNU nano
##
## markdown.nanorc 1.0.1 (March 06 2012)
## https://gist.github.com/1980496
##
## license: MIT License
##
## copyright (C) 2012 hekt <http://www.hekt.org/>.
##
syntax "markdown" "\.(md|mdt|mdwn)$"
@hekt
hekt / gist:3015336
Created June 29, 2012 02:41
OKWave partner site url list
#2012-06-29 http://faq.okwave.jp/EokpControl?site=default&lang=en&tid=103115&event=FE0006
http://oshiete.goo.ne.jp/
http://oshiete.eibi.co.jp/
http://bekkoame.okweb.ne.jp/
http://oshiete.homes.jp
http://otasuke.goo-net.com/
http://tusinbo.okwave.jp/
http://oshiete.coneco.net/
http://kaigo.okwave.jp/
http://sanwa.okwave.jp/
@hekt
hekt / gist:3015390
Created June 29, 2012 02:53
Wikipedia clone site url list
# 2012-06-29 http://ja.wikipedia.org/wiki/Wikipedia:%E3%82%A6%E3%82%A3%E3%82%AD%E3%83%9A%E3%83%87%E3%82%A3%E3%82%A2%E3%82%92%E6%83%85%E5%A0%B1%E6%BA%90%E3%81%A8%E3%81%99%E3%82%8B%E3%82%B5%E3%82%A4%E3%83%88
http://wpedia.search.goo.ne.jp/
http://wkp.fresheye.com/
http://jiten.biglobe.ne.jp/
http://encyclopedie-ja.snyke.com/index_ja.html
http://www.guajara.com/wiki/ja/wikipedia/a/a_/a_a_a_a_a_a_.html
http://www.memomsg.com/
http://www.infogogo.com/index.html
http://www.answers.com
http://monocle.jp/keyword/wiki.php
@hekt
hekt / gist:3015451
Created June 29, 2012 03:12
Google Personal Blocklist
b.hatena.ne.jp
clip.livedoor.com
ceron.jp
www.kira-ku.com
kuapi.fresheye.com
live.gummy.jp
keyword.gotowebdb.com
b.arw.cc
bookmarks.yahoo.co.jp
jobtalk.jp