Skip to content

Instantly share code, notes, and snippets.

View SpringMT's full-sized avatar

Spring_MT SpringMT

View GitHub Profile
@SpringMT
SpringMT / gist:c44788effba8cbf10e89
Created March 20, 2016 05:34
最高のリリースノート、ドキュメント管理ツール
## リリースノート
## ドキュメント
### バージョン管理
### import export
###
explain select * from range_test where '2000-01-01 00:00:00' <= datetime_col and datetime_col <= '2075-01-01 00:00:00' | {
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `range_test`.`id` AS `id`,`range_test`.`int_col` AS `int_col`,`range_test`.`bigint_col` AS `bigint_col`,`range_test`.`datetime_col` AS `datetime_col` from `range_test` where (('2000-01-01 00:00:00' <= `range_test`.`datetime_col`) and (`range_test`.`datetime_col` <= '2075-01-01 00:00:00'))"
}
]
explain select * from range_test where '2000-01-01 00:00:00' <= datetime_col and datetime_col <= '2070-01-01 00:00:00' | {
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `range_test`.`id` AS `id`,`range_test`.`int_col` AS `int_col`,`range_test`.`bigint_col` AS `bigint_col`,`range_test`.`datetime_col` AS `datetime_col` from `range_test` where (('2000-01-01 00:00:00' <= `range_test`.`datetime_col`) and (`range_test`.`datetime_col` <= '2070-01-01 00:00:00'))"
}
]
create_table "foo", id: :bigint, unsigned: true do |t|
t.integer "test_id", limit: 8, null: false, unsigned: true
t.string "name", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "foo", ["name"], unique: true
# 帯域制限と遅延の設定
export DEV=eth0
sudo tc qdisc add dev $DEV root handle 1: tbf rate 64kbit burst 10kb
peakrate 128kbit latency 100ms minburst 1540
sudo tc qdisc add dev $DEV parent 1:0 handle 10: netem delay 100ms
10ms loss 0.5%
# 意味: 帯域を64kbpsに制限、バッファサイズ10kbyte、最大転送速度 128kbit、キューでの最大待ち時間100ms
# 100ms±10msで遅延、パケットロス率0.5%
# 上記の設定の場合の変更
@SpringMT
SpringMT / gist:2e23f6b5c42d7b8f3e73
Created October 12, 2015 14:20
今やっておきたいこと
## 技術面
* 開発効率を上げる技術
* docker
* 今勉強しておくべきこと
* Go
* C++
* ドメイン駆動とそれを実現するためのコード
<% if first_page? %>
<%= paginate @products, rel: "nofollows" %>
<% else %>
<%= paginate @products %>
<% end %>
<% if first_page? %>
<%= hogehoge %>
<% else %>
<%= %>
#include <ngx_config.h>
#include <ngx_core.h>
#include <nginx.h>
static u_char *ngx_conf_file;
int main(int argc, char *const *argv)
{
ngx_buf_t *b;
@SpringMT
SpringMT / gist:6313458116b73556d417
Created January 23, 2015 16:20
JSON::Validator.validate遅い。。。
require 'json'
require 'json-schema'
json_data = []
70_000.times do |i|
json_data << {id: i, name: "てすとてすと", point: 20495, description: "しらたま"}
end

1章

重要な用語

1.認証(Authentication) ユーザ自身が何者であると主張しているかを検証するプロセス ユーザ名が表すのはユーザが主張するアイデンティティであり、アプリケーション側は、ユーザの入力したパスワードが正しければ、本人であるとみなす

2.連合型認証(Federated Authentication) ユーザアイデンティティの検証プロセスを外部サービスに依存しているアプリケーションのことをいう。