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
  • SQLアンチパターン
  • やさしく学ぶ 機械学習を理解するための数学のきほん 〜アヤノ&ミオと一緒に学ぶ 機械学習の理論と数学、実装まで〜
  • SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム
  • Real World HTTP ―歴史とコードに学ぶインターネットとウェブ技術
  • リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック
  • http://amzn.to/2yQ5hnq
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'
@fukata
fukata / README.md
Last active August 10, 2017 21:49
マルチサイト化したWordPressから新規に作ったWordPressに記事を統合する

ゴール

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

理由

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

現状

@fukata
fukata / convert_https.php
Last active July 3, 2017 11:51
Let's Encrypt
<?php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '');
/** MySQL database username */
define('DB_USER', '');
/** MySQL database password */
define('DB_PASSWORD', '');
@fukata
fukata / s3_backup.pl
Created December 26, 2013 15:35
s3 backup script
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Dumper;
use DateTime;
use Getopt::Long;
use File::Basename;
use Carp;