Skip to content

Instantly share code, notes, and snippets.

View evalphobia's full-sized avatar

evalphobia

View GitHub Profile
@evalphobia
evalphobia / せってい.md
Last active August 29, 2015 14:05
開発用 メール送信先 制限設定(posfix)

postfixのインストールと起動

$ su - 
# yum install postfix
# alternatives --display mta  # 確認
# alternatives --config mta  # 確認

2 プログラムがあり 'mta' を提供します。
@evalphobia
evalphobia / capture_dbstatus.rb
Last active August 29, 2015 14:06
Send MySQL Innodb Status
#!/usr/bin/env ruby
require 'mail'
#======================
# config
#======================
# db setting
mycnf_path="/usr/lib/zabbix/scripts/<your-database>.conf"
@evalphobia
evalphobia / learning_go.md
Last active August 29, 2015 14:10
Learning Go を読み進める

Ch.1 イントロダクション

  • Goとは
  • v1 が最初の安定版(現在はv1.3)
  • 公式ドキュメント
% go doc builtin

Hello World

#!/bin/bash
#===================
# Config
#===================
REPO_ROOT=`git rev-parse --show-toplevel`
GOLINT_TMP="/tmp/.golint.txt"
TSLINT_TMP="/tmp/.tslint.txt"
@evalphobia
evalphobia / sample.sh
Last active August 29, 2015 14:19
推薦システムを試してみる
# ダウンロードは下記より
# http://examples.oreilly.com/9780596529321/
$ cd Downloads/PCI_Code\ Folder/chapter2/
$ python
# 推薦モジュールのインポート
>>> import recommendations
# 映画批評家のLisa RoseとGene Seymourの類似性を計算する
@evalphobia
evalphobia / README.md
Created May 12, 2015 15:27
geek salon vol.7
@evalphobia
evalphobia / ch10_brainwweight.csv
Last active August 29, 2015 14:21
Rによるやさしい統計学
species body_weight brain_weight
Mountain_Beaver 1.35 8.1
Cow 465 423
Grey_Wolf 36.33 119.5
Goat 27.66 115
Guine_Pig 1.04 5.5
Diplodocus 11700 50
Asian_Elephant 2547 4603
Donley 187.1 419
Horse 521 655
@evalphobia
evalphobia / atoi_test.go
Last active February 13, 2023 16:12
golang benchmark: String and Int conversions
package bench
import (
"strconv"
"testing"
)
var smallStr = "35"
var bigStr = "999999999999999"
package main
import "fmt"
func main() {
p := []string{"Tokyo", "Kyoto", "Osaka", "Nagoya"}
res := createPermurations(p)
fmt.Printf("%v\n", res)
}
require 'ltsv'
require 'json'
result = {}
STDIN.each do |line|
record = LTSV.parse(line)
path = false
res = record[0]
next if res.nil?