Skip to content

Instantly share code, notes, and snippets.

@mizzy
mizzy / main.go
Created June 9, 2014 05:34 — forked from fujiwara/main.go
package main
import (
"encoding/json"
"github.com/mizzy/consul-catalog"
"log"
"os"
"reflect"
"time"
)
@mizzy
mizzy / 0_reuse_code.js
Created March 20, 2014 06:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mizzy
mizzy / puppet.rb
Created July 8, 2013 03:29 — forked from niw/puppet.rb
#!/usr/bin/env ruby
# Puppet command running without SSL. Try:
# $ ruby puppet.rb master --debug --no-daemonize --logdest console
# $ ruby puppet.rb agent --server 127.0.0.1 --debug --no-daemonize --onetime --noop
require "puppet/util/command_line"
require "puppet/network/http/connection"
require "puppet/network/http/webrick"

ヒューマンエラーを許容する

  • 「きをつけよう」は意味ない
  • 実装、プラクティス、プロセスに落とし込む

バグ、ミスオペの混入を防ぐ

  • コードレビュー
  • 二人で作業
  • テストケース
@mizzy
mizzy / gist:5002809
Created February 21, 2013 06:56 — forked from mala/gist:5002784
このLEMONってのがrapgeniusの人ね。
http://cache.gyazo.com/91f2e906a220fbeef2e9283b0aee597a.png
Unicorn使っても2workerで動いているところに遅いリクエストが3件来たら詰まるよ!!
根本的な解決にならない!!
とか言ってるんですよ。
じゃあ例えば、並列数1x10と並列数2x5で遅いリクエスト5件投げてキューに詰まる確率を考えてみよう。
絵で表すとこう。絵じゃなくて文字だけど。

ヒューマンエラーを許容する

  • 「きをつけよう」は意味ない
  • 実装、プラクティス、プロセスに落とし込む

バグ、ミスオペの混入を防ぐ

  • コードレビュー
  • 二人で作業
  • テストケース
@mizzy
mizzy / convert_trac.rb
Created October 29, 2011 07:51 — forked from somebox/convert_trac.rb
Convert Trac Wiki to Markdown
#!/usr/bin/env ruby
# Convert Trac DB Wiki pages to Markdown source files
# This script is based on http://github.com/seven1m/trac_wiki_to_github which
# converted all pages from a Trac DB to GitHub Wiki format (as Textile).
#
# I made two changes:
# - uses MarkDown format instead
# - uses the sqllite3-ruby gem which does not need Ruby 1.9