This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://www.namazu.org/~tsuchiya/sdic/index.html | |
(require 'sdic) | |
;; hg clone http://hg.pqrs.org/commandline-dictionary-app | |
(defvar dict-bin "/Users/masutaka/repository/commandline-dictionary-app/src/dict" | |
"a path of commandline-dictionary-app") | |
(defun dictionary-app (word) | |
"Display the meaning of word using Dictionary.app." | |
(interactive (list (sdic-read-from-minibuffer))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun anything-for-elscreen () | |
"preconfigured `anything' for anything-for-elscreen" | |
(interactive) | |
(anything anything-c-source-elscreen | |
nil nil nil nil "*anything for elscreen*")) | |
(define-key global-map (kbd "s-e") 'anything-for-elscreen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun open-chalow () | |
"Open the URL that is matched the article under the cursor" | |
(interactive) | |
(let ((date-regexp "^\\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\\)") | |
(date) | |
(entry-id 1) | |
(current (point))) | |
(save-excursion | |
(setq date (and (re-search-backward date-regexp (point-min) t) | |
(match-string-no-properties 1)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Link to the Twitter account | |
# usage: {{twitter('ACCOUNT')}} | |
# Ex. {{twitter('masutaka')}} | |
sub twitter { | |
my ($account) = @_; | |
return qq(<a href="https://twitter.com/${account}" target="_blank">\@${account}</a>); | |
} | |
### Embedded Tweet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git '/home/masutaka/.plenv' do | |
repository 'git://github.com/tokuhirom/plenv.git' | |
reference 'master' | |
user 'masutaka' | |
group 'masutaka' | |
action :sync | |
end | |
directory '/home/masutaka/.plenv/plugins' do | |
owner 'masutaka' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires 'GrowthForecast'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem_package 'fluent-plugin-mongo' do | |
gem_binary '/usr/lib/fluent/ruby/bin/fluent-gem' | |
action :install | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w(fluent-plugin-mongo fluent-plugin-growthforecast).each do |pkg| | |
gem_package pkg do | |
gem_binary '/usr/lib/fluent/ruby/bin/fluent-gem' | |
action :install | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w(fluent-plugin-mongo fluent-plugin-growthforecast fluent-plugin-datacounter).each do |pkg| | |
gem_package pkg do | |
gem_binary '/usr/lib/fluent/ruby/bin/fluent-gem' | |
action :install | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'foursquare2' | |
client = Foursquare2::Client.new(:oauth_token => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') | |
client.user_checkins({'offset' => 0, 'limit' => 30})[:items].each do |checkin| | |
name = checkin[:venue][:name] | |
lng = checkin[:venue][:location][:lng] | |
lat = checkin[:venue][:location][:lat] | |
printf "%s %f %f\n", name, lng, lat | |
end |