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
let timefile = expand('~/.neobundle_updatetime') | |
if filereadable(timefile) | |
let time = join(readfile(timefile), "") | |
if time < system('date +%s') | |
let time = system('date -d "1 days" +%s') | |
call writefile([time], timefile) | |
silent! execute '!sh -c "~/.vim/bundle/neobundle.vim/bin/neoinstall" 2>/dev/null &' | |
endif | |
else | |
let time = system('date -d "1 days" +%s') |
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 'open-uri' | |
require 'amazon/ecs' | |
jans = [] | |
url = 'http://www.bookoffonline.co.jp/display/L001,sk=10,bg=120902,row=50,pr=u-108,st=u,' | |
1.upto(30).map {|i| url + "p=#{i},"}.each do |url| | |
doc = Nokogiri::HTML(open(url), nil, 'CP932') | |
doc.css('.itemttl').each do |link| | |
path = link.xpath('a')[0].attributes['href'].value |
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 'amazon/ecs' | |
Amazon::Ecs.options = { | |
AWS_access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
AWS_secret_key: ENV['AWS_SECRET_KEY'], | |
associate_tag: ENV['ASSOCIATE_TAG'], | |
} | |
# 本の人気ランキング取得 | |
res = Amazon::Ecs.item_search( |
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
// see http://code.ohloh.net/file?fid=kXVN5HCJK4Nv7fjwDTtngR5gaug&cid=RhmXKV7xKoA&s=&fp=386616&mp&projSelected=true#L0 | |
var page_url = 'http://hitode909.hatenablog.com/entry/2014/03/17/201717'; | |
var frame_width = 640; | |
var frame_height = 390; | |
var frame_interval = 80; // 25fps if time_factor = 2 | |
var max_frames = 50; // 10 minutes @ 25fps | |
var frame_dir = 'frames'; // where PNG files will be written | |
console.log('start'); |
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 'tempfile' | |
post_dir = 'source/_posts' | |
files = Dir.glob("#{File.expand_path(post_dir)}/*") | |
files.each do |file| | |
p file | |
temp = Tempfile::new('temp') | |
open(file, 'r') do |f| | |
f.each do |line| | |
if line.index(/!\[[0-9]+\..+\]/) |
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 'twitter' | |
require 'google-search' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = ENV['consumer_key'] | |
config.consumer_secret = ENV['consumer_secret'] | |
config.access_token = ENV['access_token'] | |
config.access_token_secret = ENV['access_token_secret'] | |
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 'sinatra' | |
require 'open-uri' | |
require 'nokogiri' | |
get '/' do | |
url = "http://negineesan.com" | |
@imgs = [] | |
doc(url).xpath('//p[@align="left"]/a').each do |a| | |
num = a[:href].gsub(/[^0-9]/, '').to_i | |
num = "%03d" % num |
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 'tumblife' | |
require 'pp' | |
Tumblife.configure do |config| | |
config.consumer_key = ENV['CONSUMER_KEY'] | |
config.consumer_secret = ENV['CONSUMER_SECRET'] | |
config.oauth_token = ENV['OAUTH_TOKEN'] | |
config.oauth_token_secret = ENV['OAUTH_TOKEN_SECRET'] | |
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 'mqtt' | |
require 'uri' | |
uri = URI.parse(ENV['ACCESS_POINT']) | |
client = MQTT::Client.connect( | |
remote_host: uri.host, | |
remote_port: uri.port, | |
username: ENV['USER'], | |
password: ENV['PASS'], |
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
$ wpa_passphrase ssid passphrase | |
network={ | |
ssid="ssid" | |
#psk="passphrase" | |
psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 | |
} |
OlderNewer