Skip to content

Instantly share code, notes, and snippets.

View sakuemon's full-sized avatar

Tsuyoshi MIYAMOTO sakuemon

View GitHub Profile
package tx
import "fmt"
type DB struct {
committed bool
}
func NewDB() *DB {
db := DB{
  • gem 'cells', "~> 4.0.0"
  • gem 'cells-erb'
  • gem 'config'
  • gem 'draper'
  • gem 'password_strength'
  • gem 'sorcery'
  • gem 'validates_email_format_of'
@sakuemon
sakuemon / 1_.md
Created February 19, 2016 05:16 — forked from gakuzzzz/1_.md
Scala の省略ルール早覚え

Scala の省略ルール早覚え

このルールさえ押さえておけば、読んでいるコードが省略記法を使っていてもほぼ読めるようになります。

メソッド定義

def concatAsString(a: Int, b: Int): String = {
  val a_ = a.toString();
  val b_ = b.toString();
@sakuemon
sakuemon / how_to_build_php_on_el_capitan.md
Created January 21, 2016 07:05
How to build php on el capitan

たぶん、以下の手順でOK。 5.6.17と7.0.2はできた。 環境変数は.zshrcなり.bashrcに設定したほうが良いか。

$ brew install openssl
$ brew link openssl —force
$ export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH
$ export CPATH=/usr/local/opt/openssl/include:$CPATH
$ export LDFLAGS='/usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/openssl/lib/libcrypto.dylib'

多分こんな感じ。

ライブラリ側での操作

リポジトリの作成

  1. srcフォルダの追加
  2. composer.jsonの追加
{
  "name": "package_name/sub_name",
  "description": "package description",

Intellij IDEAでのPHP remote debug

Debugの設定

Preference -> Languages & Frameworks -> PHP -> Debugを選択 Xdebugのポートをphp.ini等に設定したxdebug.remote_portに合わせる。

Serverの設定

Preference -> Languages & Frameworks -> PHP -> Serversを選択 Serverを追加する。 Use path mappingsにチェックを付ける。

@sakuemon
sakuemon / setup_local_dev_machine.md
Last active August 29, 2015 14:27
ローカル開発環境の作成手順

#IP,ローカルドメインを決める IPはhostsを見て、適当に決める。 ドメインはservice-name.local。

#環境設定 -> hosts に追加 上記設定を追加。

#githubからdev_machineをclone

#各所を変更

@sakuemon
sakuemon / gist:9923a7a3aee1e2e60776
Created May 7, 2015 13:36
show required modules for ruby
$LOADED_FEATURES.
select { |feature| feature.include? 'gems' }.
map { |feature| File.dirname(feature) }.
map { |feature| feature.split('/').last }.
uniq.sort

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
@sakuemon
sakuemon / gist:23ac5051e1f25a246486
Created January 12, 2015 03:13
boot2docker tutorial
after install boot2docker...
(a boot2docker include docker command.You DON'T need install docker)
$ boot2docker init
$ boot2docker up
$ $(boot2docker shellinit) # set docker envs
$ boot2docker ip # show ip