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 / ctrl-g-to-esc-unless-iterm2.json
Last active December 6, 2022 00:45
^g => esc unless iTerm2
{
"title": "esc = ctrl + g unless iTerm2",
"rules": [
{
"description": "Control + g => Escape unless iTerm2",
"manipulators": [
{
"from": {
"key_code": "g",
"modifiers": {
@hekt
hekt / notion-disable-ctrl-shift-j-hotkey.user.js
Created December 5, 2022 11:30
disable ^J on notion.so
// ==UserScript==
// @name Notion ^J disabler
// @namespace https://kzt.sh/
// @version 0.1
// @description disable ^J on notion.so
// @author hektorg@gmail.com
// @match https://www.notion.so/*
// @grant none
// @run-at document-start
// ==/UserScript==
@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 / 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 / BigLetterView.h
Created November 17, 2014 13:34
MAC OS X COCOA プログラミング 23章で dragImage が使われているところ を beginDraggingSessionWithItems で書く
@interface BigLetterView : NSView <NSDraggingSource> {
NSColor *bgColor;
NSString *string;
NSMutableDictionary *attributes;
NSEvent *mouseDownEvent;
}
@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 / .dir_colors
Created July 3, 2017 23:26
.dir_colors
# Configuration file for the color ls utility
# Synchronized with coreutils 8.5 dircolors
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
@hekt
hekt / background.js
Created July 25, 2013 12:44
skip hatebu
(function() {
var urls = ['http://b.hatena.ne.jp/entry/',
'http://zenback.itmedia.co.jp/contents/',
'http://ceron.jp/url/'];
chrome.tabs.onUpdated.addListener(function(tabid, inf, tab) {
for (var i = 0; i < urls.length; i++) {
if (inf.url.indexOf(urls[i]) === 0) {
var newUrl = inf.url.replace(/^(https?:\/\/).*?\/.*?\/(.*)$/, '$1$2');
chrome.tabs.update(tabid, {"url": newUrl});