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 / diff-selected-buffers.l
Created December 19, 2012 02:20
[xyzzy] いま開いているバッファを diff する。ウィンドウを二つ開いておくこと。
(defun diff-selected-buffers ()
(interactive)
(let (file1 file2)
(setq file1 (get-buffer-file-name (selected-buffer)))
(other-window)
(setq file2 (get-buffer-file-name (selected-buffer)))
(diff file1 file2)))
@sharapeco
sharapeco / typesquarefix.js
Created January 16, 2013 10:16
モリサワ TypeSquare が @font-face ルールを作成するときに、ウェイト情報が含まれないので、そこをいいがにする (Firefox のみ有効)
(function() {
var fl = document.styleSheets.length
, timer = setInterval(watch, 100)
;
function watch() {
if (fl === document.styleSheets.length) return;
clearInterval(timer);
iiganisuru();
}
@sharapeco
sharapeco / IshikawaAirPollutionAPI.rb
Last active December 14, 2015 12:58
石川県の大気環境の状況を取得。作りかけ。 取得元 http://www.pref.ishikawa.jp/cgi-bin/taiki/top.pl / プロジェクト継続先 https://github.com/kitak/ishikawa_air_pollution
require 'rubygems'
require 'mechanize'
class IshikawaAirPollutionAPI
def initialize()
@use_sleep = false
@agent = Mechanize.new
@agent.user_agent_alias = 'Mac Safari'
@sharapeco
sharapeco / yahoo_japan_mail.user.css
Last active December 15, 2015 00:39
Yahooメール(ベータ版)を広々と使うためのユーザスタイルシート。Stylish などのアドオンをインストールして使います。2013-04-01 更新
#theAd,
.ad_NW,
.col-b,
[id*="ads_"],
[class*="ads_"] { display: none !important; }
/*
#main,
.nav-bar,
#shellcontent { margin-top: -100px; }
@sharapeco
sharapeco / Makefile
Last active December 15, 2015 11:19
Excel から出力した UTF-16LE のタブ区切りテキストを UTF-8 の CSV ファイルにするスクリプト、と、それをさらに JSON にするスクリプトと Makefile
SRC_DIR = src
TMP_DIR = utf8
DEST_DIR = json
CSVS = $(wildcard $(addsuffix /*.csv,$(SRC_DIR)))
JSONS = $(subst $(SRC_DIR)/,$(DEST_DIR)/,$(CSVS:.csv=.json))
.PHONY: all
all: $(JSONS)
@sharapeco
sharapeco / .xyzzy
Created March 29, 2013 02:41
.xyzzy
(require "ni/setup")
(ni-autoload)
;; diff
(setq ed::*diff-command-name*
(map-slash-to-backslash (merge-pathnames "~xyzzy/bin/diff.exe" (user-homedir-pathname))))
(defun diff-selected-buffers ()
(interactive)
(let (file1 file2)
@sharapeco
sharapeco / .htaccess
Last active December 17, 2015 02:08
某ミーショップ在庫更新API。あらかじめ書き込み可能なディレクトリ data を作っておいてください。
# Web API として使うためのファイル (1)
# Web サーバ上の適当なディレクトリに置いて使う。
# mod_rewrite が必要
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.rb?url=$1 [QSA,L]
@sharapeco
sharapeco / facebox.css
Created May 20, 2013 01:38
[あとでFork] Facebox私家版。CSS3で軽量化。 http://defunkt.io/facebox/
#facebox {
position: absolute;
top: 0;
left: 0;
z-index: 100;
text-align: left;
background: #878787;
background: rgba(82, 82, 82, 0.7);
border-radius: 8px;
-webkit-border-radius: 8px;
@sharapeco
sharapeco / NormalizeString.vba
Created May 21, 2013 06:08
半角カナを全角に、全角英数字を半角にだいたい変換する関数 Excel 用
Private Function NormalizeString(ByVal source As Variant) As Variant
Dim i As Integer
Dim c As Variant
Dim result As Variant
result = ""
For i = 1 To Len(source)
c = StrConv(source, vbWide)
If Mid(c, i, 1) Like "[A-z]" Or Mid(c, i, 1) Like "[0-9]" Or Mid(c, i, 1) Like "-" Then
@sharapeco
sharapeco / components.less
Created May 27, 2013 02:10
オレオレBootstrap
//////////////////////////////////////////////////////////////////
// Components
@keyframes fade-in {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-webkit-keyframes fade-in {
0% { opacity: 0; }
100% { opacity: 1; }
}