Skip to content

Instantly share code, notes, and snippets.

View sss's full-sized avatar

SASAKI Suguru sss

View GitHub Profile
@sss
sss / .git--config
Created June 17, 2012 18:11
Updating metadata for gitinfo (in TeX Live)
[hooks.tex.gitinfo]
prefix = .
prefix = ./test
prefix = ./docs
@sss
sss / executable-with-subcommands-using-thor.log
Created February 24, 2012 20:16
Revised: Namespacing thor commands in a standalone Ruby executable
$ ./executable-with-subcommands-using-thor.rb
Tasks:
executable-with-subcommands-using-thor.rb help [TASK] # Describe available tasks or one specific task
executable-with-subcommands-using-thor.rb subA [TASK] # Execute a task in namespace subA
executable-with-subcommands-using-thor.rb subB [TASK] # Execute a task in namespace subB
executable-with-subcommands-using-thor.rb test # test in CLI
$ ./executable-with-subcommands-using-thor.rb help
Tasks:
executable-with-subcommands-using-thor.rb help [TASK] # Describe available tasks or one specific task
@sss
sss / solarized-for-teraterm.ini
Created September 16, 2011 11:25
Solarized for TeraTerm
;
; Solarized [1] for TeraTerm [2]
;
; [1] <http://ethanschoonover.com/solarized>
; [2] <http://ttssh2.sourceforge.jp/>
;
; * Add this to your TERATERM.ini
; * ANSIColor setting is the same between Solarized Light and Dark,
; but you need to choose VTColor and VTReverseColor settings
; depending on your flavour (Light or Dark).
@sss
sss / gist:1111195
Created July 28, 2011 08:20
HOWTO: Setup "Calendar and Contacts Server" behind Apache 2.2 with SSL
This HOWTO is about...
* You already installed Apache HTTPd 2.2 with SSL (mod_ssl or mod_gnutls)
* and want to setup "Calendar and Contacts Server" behind it
1. You can install "Calendar and Contacts Server"
(http://trac.calendarserver.org/) under Debian, as follows:
$ apt-get install calendarserver
@sss
sss / draft.rb
Created June 23, 2011 02:53 — forked from no6v/draft.rb
module Earthquake::Input
def drafts
@drafts ||= []
end
end
Earthquake.init do
d = drafts
subcommands = {
apply: ->(index){Readline::HISTORY.push(d.at(Integer(index)))},
@sss
sss / googl-for-earthquake.rb
Created April 29, 2011 22:41
Google URL Shortener for earthquake.gem
# Google URL Shortener for earthquake.gem
require 'googl'
Earthquake.init do
_ = config[:googl] ||= {}
_[:username] ||= ''
_[:password] ||= ''
_[:only_long_tweet] ||= false
@sss
sss / try-alternate-file-name-when-failed.patch
Created April 23, 2011 20:08
Try an alternate file name when failed to decode the final component of URI in Zotero 2.1.6
Zotero 2.1.6 is failing to capture a web page,
whose URI has the final component which can't be
decoded with decodeURIComponent().
(e.g. URI has the final component in non UTF-8 encoded string)
This patch is a workaround for this against /extension/branches/2.1 .
When failed to decode the final component with decodeURIComponent(),
try base64 of SHA-1 of the final component as an alternate file name.
---
@sss
sss / imgur.rb
Created April 21, 2011 14:12 — forked from jugyo/imgur.rb
earthquake.gem imgur command
Earthquake.init do
config[:imgur] ||= {api_key: '5cb04404b1ff26a88cbfe42de5aba23f'}
command :imgur do
require 'tempfile'
image_path = Tempfile.open('imgur').path
puts "capture an image from the screen!"
system 'screencapture', '-s', image_path # NOTE: Mac only :(
unless File.size(image_path) == 0
input ":imgur #{image_path}"
@sss
sss / screen_name_prompt.rb
Created April 21, 2011 14:12 — forked from ryumu/screen_name_prompt.rb
Earthquake.gemのプロンプトにユーザー名を出すよ!プラグイン
# coding: UTF-8
Earthquake.init do
once do
config[:prompt] = twitter.info['screen_name'] + config[:prompt]
end
end
@sss
sss / event_notifier.rb
Created April 21, 2011 14:11 — forked from jugyo/event_notifier.rb
event_notifier.rb
# event_notifier plugin
Earthquake.init do
output do |item|
if item["event"] && item["source"]["screen_name"] != twitter.info["screen_name"]
notify "#{item["source"]["screen_name"]} => #{item["target"]["screen_name"]}" +
(item["target_object"] ? " : #{item["target_object"]["text"].u}" : ""),
:title => "[#{item["event"]}]"
end
end
end