Skip to content

Instantly share code, notes, and snippets.

View sharapeco's full-sized avatar
💭
Tengo hambre

Shinichiro Yabu sharapeco

💭
Tengo hambre
View GitHub Profile
@sharapeco
sharapeco / .zshrc
Last active February 7, 2018 05:01
My zsh config
autoload -Uz zmv
autoload -U compinit
compinit
autoload -Uz vcs_info
autoload colors
colors
### 補完時に大小文字を区別しない
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' menu select=1
@sharapeco
sharapeco / 市外局番-石川県.tsv
Created September 11, 2017 07:22
石川県の市外局番
0761 小松市
0761 能美市
0761 加賀市
076 金沢市
076 かほく市
076 野々市市
076 白山市
076 河北郡
076 能美郡
0767 七尾市
@sharapeco
sharapeco / wysiwygetize.js
Last active April 10, 2017 05:17
wysiwygetize (by Spharian) readable code
jQuery.fn.wysxiwygetize = function(aOptions) {
var selection;
var $self = this,
$lastFocusedTextarea,
$lastFocusedEditor,
isFocused = false,
scrollTop,
fullScreenEditorId,
tabIndex = 0,
hasTabInput = false,
@sharapeco
sharapeco / check_commands.sh
Created October 31, 2014 02:13
check_commands.sh
#!/bin/sh
# @param $1 = command
function command_exists() {
if type $1 > /dev/null 2>&1; then
return 1
else
return 0
fi
}
@echo off
rem ローカルテスト Web サーバの設定ファイルを生成する
rem mkwebconf <サーバ名>
if '%1'=='' goto USAGE
echo 次の設定でテスト Web サーバ設定を作成します。
echo ServerName: %1
echo.
@sharapeco
sharapeco / my-buf-menu.l
Created June 20, 2014 09:13
my-buf-menu.l
;;; -*- Mode: Lisp; Package: EDITOR -*-
;;;
;;; This file is part of xyzzy.
;;;
(provide "buf-menu")
(in-package "editor")
(export '(*buffer-menu-mode-hook* list-buffers buffer-menu
@sharapeco
sharapeco / 食べログカテゴリ一覧.tsv
Created April 22, 2014 04:40
食べログカテゴリ一覧
レストラン
和食
日本料理
懐石・会席料理
割烹・小料理
精進料理
京料理
寿司・魚介類
寿司
回転寿司
@sharapeco
sharapeco / ef-lens.js
Created April 9, 2014 01:04
キヤノンのEFレンズの名前にマッチする正規表現
/\b(?:EF(?:-[SM])?|TS-E)[1-9][0-9]*(?:-[1-9][0-9]+)?mm F[0-9]+(?:\.[0-9]*[1-9])?(?:-[0-9]+(?:\.[0-9]*[1-9])?)?(?:L| DO)?(?: (?:コンパクト)?マクロ| フィッシュアイ)?(?: IS)?(?: III?)?(?: USM| STM)?(?: エクステンダー 1\.4×)?|\bMP-E65mm F2\.8 1-5×マクロフォト/
@sharapeco
sharapeco / download_test.php
Last active August 27, 2018 03:17
Content-Disposition: attachment で日本語ファイル名をダウンロードさせるテスト
<?php
$t = isset($_GET['t']) ? $_GET['t'] : null;
$org = '此のファイル test.php';
$fn = array(
'A: UTF-8 Raw' => 'Content-Disposition: attachment; filename="' . $org . '"',
'B: UTF-8 URL Encoded' => 'Content-Disposition: attachment; filename="' . rawurlencode($org) . '"',
'C: UTF-8 Base64 Encoded' => 'Content-Disposition: attachment; filename="=?utf-8?B?' . base64_encode($org). '?="',
'D: RFC 2231' => 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode($org),
@sharapeco
sharapeco / less-1.6.0-jvariable.patch
Created January 7, 2014 13:08
LESS を日本語の変数名に対応させるパッチ
diff -Naru less.orig/lib/less/parser.js less/lib/less/parser.js
--- less.orig/lib/less/parser.js 2014-01-02 02:36:49.000000000 +0900
+++ less/lib/less/parser.js 2014-01-07 22:04:08.000000000 +0900
@@ -921,7 +921,7 @@
variable: function () {
var name, index = i;
- if (input.charAt(i) === '@' && (name = $re(/^@@?[\w-]+/))) {
+ if (input.charAt(i) === '@' && (name = $re(/^@@?[\w一-龠ぁ-んァ-ヴ-]+/))) {
return new(tree.Variable)(name, index, env.currentFileInfo);