Skip to content

Instantly share code, notes, and snippets.

@sonota88
sonota88 / block-indent.el
Created May 15, 2011 02:26
block-indent.el
;; block-indent.el
;; author: sonota
;; license: GPL
;; save-excursionとカーソル周辺のブロック(関数など)の自動インデントを組み合わせてみた - 再発明日記
;; http://d.hatena.ne.jp/sonota88/20101218/1292678664
;;;;
;; ルールの書式:
;; ((modes) ; 関連付けるメジャーモードのリスト
(require 'imcap)
(setq imcap-file-name-format "%Y-%m-%d-%H%M%S.png")
(setq imcap-directory "imcap")
(setq imcap-capture-delay 5)
(defun imcap-capture-command-format ()
(concat " sleep "
(format "%s" imcap-capture-delay)
" ; "
@sonota88
sonota88 / gist:911285
Created April 9, 2011 10:00
hatebu-more.user.js
// ==UserScript==
// @name hatebu-more
// @namespace anbt
// @include http://b.hatena.ne.jp/entry/*
// @exclude http://b.hatena.ne.jp/entry?mode=more&url=*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js
// ==/UserScript==
var moreURL = "http://b.hatena.ne.jp" + $("#more-link > a").attr("href");
@sonota88
sonota88 / dot.emacs.el
Last active September 25, 2015 10:18
.emacs.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; OS判別
;; .emacs で OS の判定を関数化しよう - msshの日記
;; http://d.hatena.ne.jp/mssh/20081208/1228742294
;; を少し修正
(defvar os-type nil)
(setq os-type (cond
@sonota88
sonota88 / twitter-dt.user.js
Created March 21, 2011 01:41
Twitter から sinsai.info へのレポート用。日付をフォーマットして表示+コピペしやすいように
// ==UserScript==
// @name twitter-dt
// @namespace anbt
// @include http://twitter.com/*/status/*
// @include http://twitter.com/*/statuses/*
// @include https://twitter.com/*/status/*
// @include https://twitter.com/*/statuses/*
// ==/UserScript==
/*
@sonota88
sonota88 / check-engineer-blog-hatom.rb
Created March 7, 2011 14:42
IT・ウェブ系企業エンジニアブログのhAtom対応状況を調べてみた http://d.hatena.ne.jp/sonota88/20110307/1299510096
# -*- coding: utf-8 -*-
require "pp"
require "rubygems"
require "mofo"
list_src = <<EOB
株式会社インフィニットループ技術ブログ - 札幌のソフト開発会社インフィニットループのスタッフが送る技術ブログ
http://www.infiniteloop.co.jp/blog/
BPS株式会社 開発ブログ Beyond Perspective Solutions LTD.
@sonota88
sonota88 / count-japanese-chars.el
Created February 27, 2011 14:54
Emacs Lisp to count Japanese zenkaku/hankaku character mixed string.
(defun asciip (char-code)
(and (<= 32 char-code)
(<= char-code 126)))
;; (asciip ?a) ; => t
;; (asciip ?あ) ; => nil
;; see also: japan-util.el
;; char-code のリスト
@sonota88
sonota88 / custom_plus.rb
Created February 20, 2011 21:22
yapra/plugins/feed/custom_plus.rb / Extract feed using user defined XPath or hAtom or LDRize siteinfo.
# -*- coding: utf-8 -*-
#require 'pp'
require 'open-uri'
require 'time'
require 'rss'
require 'rubygems'
require 'yapra/plugin/mechanize_base'
module LDRize
@sonota88
sonota88 / extract.rb
Created February 13, 2011 12:57
yapra/plugins/feed/extract.rb / Extract feed using user defined XPath or hAtom.
# -*- coding: utf-8 -*-
require 'yapra/plugin/mechanize_base'
module Yapra::Plugin::Feed
# description:
#
# Extract as feed from a web page using hAtom or user defined XPath.
#
@sonota88
sonota88 / detect-patterns.user.js
Created January 29, 2011 15:24
Greasemonkey script which detect patterns in html source.
// ==UserScript==
// @name detect-patterns
// @namespace anbt
// @include *
// ==/UserScript==
(function(){
if (window != unsafeWindow.top) { return; }