View memolist2dayone.rb
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 'rb-dayone' | |
require 'optparse' | |
require 'json' | |
dry_run = true | |
journal_location = "#{ENV['HOME']}/Library/Group Containers/5U8NS4GX82.dayoneapp2/Data/Auto Import/Default Journal.dayone" | |
target_dir = "#{ENV['HOME']}/Dropbox/memolist/" | |
since = Date.today | |
exclude = nil |
View github-flavored-markdown.rb
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
#!/usr/bin/env ruby | |
# @author Aaron Lampros | |
# | |
# Github-flavored markdown to HTML, in a command-line util. | |
# | |
# $ cat README.md | ./github-flavored-markdown.rb | |
# | |
# Notes: | |
# You will need to install Pygments for syntax coloring | |
# ```bash |
View nippo.vim
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
map <Leader>np :MemoNewWithMeta 'ニッポー', '"ニッポー", "YAMAP"', 'Work'<CR> | |
function! s:yesterday_nippo() | |
let s:now = localtime() | |
let s:day = (60 * 60 * 24) | |
let s:yesterday = strftime("%Y-%m-%d", s:now - s:day) | |
let s:yesterday_path = g:memolist_path.'/'.s:yesterday.'-ニッポー.markdown' | |
exe "e" s:yesterday_path | |
endfunction | |
command! -nargs=* YesterdayNippo :call s:yesterday_nippo() |
View hatena_blog2dayone.rb
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 'rb-dayone' | |
module HatenaBlog | |
class Entry | |
def initialize(entry) | |
@entry = entry | |
end | |
def meta_data | |
@entry.split("-----\n")[0] |
View shinudan.rb
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
#-*- coding: utf-8 -*- | |
# shinudan tweet / earthquake plugin | |
# | |
# shinudan: http://shindanmaker.com/198940 | |
# | |
require 'net/http' | |
require 'nokogiri' | |
Earthquake.init do | |
command %r|^:shinudan\s*(.+)*|, :as => :shinudan do |m| |
View the_legacy_searcher.rb
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 'formula' | |
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook | |
# /usr/local/Library/Contributions/example-formula.rb | |
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
class TheLegacySearcher < Formula | |
homepage '' | |
url 'https://github.com/monochromegane/the_silver_searcher/archive/legacy-0.1.tar.gz' | |
sha1 '9608f10564c64081a38a345ee6848c570a0266f9' |
View always_140.rb
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
# coding: utf-8 | |
# always tweet with 140 characters | |
# port of https://gist.github.com/453709 | |
# | |
Earthquake.init do | |
command :t140 do |m| | |
max = 140 | |
body = m[1] | |
len = body.length |
View script
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'digest/md5' | |
def main | |
user = IO.popen("whoami", "r+").gets.chomp | |
file = "/Users/#{user}/Dropbox/Public/gyazo/#{Digest::MD5.hexdigest(Time.now.to_f.to_s)}.png" | |
url = 'https://dl.dropboxusercontent.com/u/2611378/gyazo/' + File.basename(file) |
View favstar.rb
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
# -*- coding: utf-8 -*- | |
# favstar / earthquakge.gem plugin | |
# | |
# e.g. :favstar #=> your favstar | |
# :favstar who #=> who's favstar | |
# | |
require 'open-uri' | |
require 'nokogiri' | |
Earthquake.init do |
View takagi.rb
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
# -*- coding: utf-8 -*- | |
# takagi RT | |
# | |
# e.g. :takagi $xx | |
# | |
Earthquake.init do | |
command %r|^:takagi\s+(\d+)$|, :as => :takagi do |m| | |
st = cache.read("status:" + m[1]) | |
text = sprintf("だったら黙ってろクソが RT @%s %s" % [st["user"]["screen_name"], st["text"]]) | |
async_e { twitter.update(text, :in_reply_to_status_id => m[1]) } if confirm("update '#{text}'") |
NewerOlder