Skip to content

Instantly share code, notes, and snippets.

View itkrt2y's full-sized avatar
✂️
Yak Shaving

Tatsuya Itakura itkrt2y

✂️
Yak Shaving
View GitHub Profile
@itkrt2y
itkrt2y / rails_https.md
Created September 21, 2018 08:40
Rails Local Development over HTTPS
@itkrt2y
itkrt2y / scrap-amazon-book.js
Last active April 8, 2018 15:47
Amazon商品ページの本の情報をScrapboxに記録する
const title = (document.querySelector("#productTitle") || document.querySelector("#ebooksProductTitle")).innerText;
let body = '[amazon ' + window.location.href + ']\n';
const orderContainer = (document.querySelector("#instantOrderUpdate") || document.querySelector("#ebooksInstantOrderUpdate"));
if (orderContainer) {
const year = new RegExp(/\d{4}/).exec(orderContainer.innerText)[0];
const year_month = new RegExp(/\d{4}\/\d{1,2}/).exec(orderContainer.innerText)[0];
body = body + 'Ordered: [' + year + '], [' + year_month + ']\n';
}