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() |
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 |
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] |
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
speculation = fs.read(jsonPath) | |
data = """ | |
speculation = #{speculation} | |
""" | |
page.evaluateJavaScript data |
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
Failures: | |
1) cleanup_users unconfirmed_users should change result | |
Failure/Error: expect { @rake['cleanup_users:unconfirmed_users'].invoke }.to \ | |
NameError: | |
undefined local variable or method `touch_paranoia_column' for #<Design:0x007fb7330ddc38> | |
# ./lib/tasks/cleanup_users.rake:38:in `block (3 levels) in <top (required)>' | |
# ./lib/tasks/cleanup_users.rake:35:in `block (2 levels) in <top (required)>' | |
# ./spec/lib/tasks/cleanup_users_spec.rb:31:in `block (4 levels) in <top (required)>' | |
# ./spec/lib/tasks/cleanup_users_spec.rb:31:in `block (3 levels) in <top (required)>' |
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
thread_started_at = Time.now | |
thread_finished_at = nil | |
for i in 1..4 do | |
Thread.start(i) do |t| | |
puts "started thread #{t}" | |
sleep 1 | |
puts "finished thread #{t}" | |
thread_finished_at = Time.now if t == 4 | |
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
#!/usr/bin/env ruby | |
require 'csv' | |
require 'active_support/all' | |
require 'rb-dayone' | |
class DiaryFromDayOne | |
attr_reader :target_date, :title, :content, :created_at | |
def initialize(row) |
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
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
!(/collaborative tweet/ =~ item["source"]) | |
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
# -*- coding: utf-8 -*- | |
# superdry tweet / earthquake plugin | |
# | |
# superdry: http://shindanmaker.com/43570 | |
# | |
require 'net/http' | |
require 'nokogiri' | |
Earthquake.init do | |
command :byunasahi do |
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 -*- | |
require 'utf8-cleaner' | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
str = UTF8Cleaner::URIString.new(item["text"]).cleaned | |
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ str) | |
end | |
end |
NewerOlder