Skip to content

Instantly share code, notes, and snippets.

View fukata's full-sized avatar

fukata fukata

View GitHub Profile
@fukata
fukata / plan.md
Last active April 26, 2018 20:18
ホーチミン - ハノイ鉄道旅のプラン

概要

現在、ダラットに滞在していてハノイからホーチミンまで向かう旅。最終的にはダラットに戻ってくる。

主な経由地(仮)

  1. ハノイ 2泊
  2. ハイフォン 1泊
  3. フエ 1泊
  4. ダナン 2泊
@fukata
fukata / docker-compose.yml
Last active April 3, 2018 09:39
This is sample of docker based rails app development
version: '3'
volumes:
app_bundle_data:
driver: local
app_node_modules_data:
driver: local
app_log_data:
driver: local
app_tmp_data:
driver: local
@fukata
fukata / deploy.rb
Created December 25, 2017 07:32
capistrano + goose
set :conditionally_migrate, fetch(:conditionally_migrate, false)
set :migration_role, fetch(:migration_role, :db)
set :migration_servers, -> { primary(fetch(:migration_role)) }
namespace :deploy do
task :set_app_env do
set :app_env, (fetch(:app_env) || fetch(:stage))
end
desc 'Runs goose up if migrations are set'
#!/usr/bin/env bash
cd app
# th_th
msgfmt -o content/languages/locale/th_th/LC_MESSAGES/messages.mo content/languages/locale/th_th/LC_MESSAGES/messages.po
class Server
def call(env)
case env['HTTP_HOST']
when 'tabearuki.fukata.org'
case env['PATH_INFO']
when '/archives/18'
return [301, { 'Location' => 'https://blog.fukata.org/archives/8011' }, [] ] # こころ庭 鳥重定食
when '/archives/35'
return [301, { 'Location' => 'https://blog.fukata.org/archives/8012' }, [] ] # Cafe+bar Petit plum
when '/archives/40'
  • SQLアンチパターン
  • やさしく学ぶ 機械学習を理解するための数学のきほん 〜アヤノ&ミオと一緒に学ぶ 機械学習の理論と数学、実装まで〜
  • SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム
  • Real World HTTP ―歴史とコードに学ぶインターネットとウェブ技術
  • リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック
  • http://amzn.to/2yQ5hnq
@fukata
fukata / README.md
Last active August 10, 2017 21:49
マルチサイト化したWordPressから新規に作ったWordPressに記事を統合する

ゴール

マルチサイト化したWordPressから新規に作ったWordPressに記事を統合する

理由

プラグインの管理などがサイト別なのでだるい。

現状

@fukata
fukata / fukata.org.conf
Last active December 22, 2016 07:30
https://fukata.org 's h2o config
user: www-data
file.custom-handler:
extension: .php
fastcgi.connect:
host: 127.0.0.1
port: 9000
type: tcp
HTTPS: on
@fukata
fukata / yahoo_auction_postage.js
Created September 13, 2016 14:05
ヤフオクの都道府県別送料設定の一覧を取得するスクリプト
tbl=document.querySelector("html > body > center > center > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > table");
pref_names = Array.prototype.map.call(tbl.querySelectorAll("td[width='1%'] > small"), function(r){ return r.innerText; });
amounts = Array.prototype.map.call(tbl.querySelectorAll("td > small > input"), function(r){ return r.value; });
output = "";
for (var i=0; i<pref_names.length; i++) {
output += pref_names[i] + ": " + amounts[i] + "\n";
}
console.log(output);
@fukata
fukata / zipcodes_dcm.txt
Last active August 1, 2016 10:33
diff pg and dcm
043-1400
043-1401
043-1402
043-1403
043-1404
043-1405
043-1406
043-1521
043-1522
043-1523