Skip to content

Instantly share code, notes, and snippets.

View ymkjp's full-sized avatar
:shipit:
while true

Kenta Long Yamamoto ymkjp

:shipit:
while true
View GitHub Profile
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
@keikubo
keikubo / README.md
Created March 20, 2012 01:38
Nginx + Unicorn for Rails on Rackhub

Nginx + Unicorn for Rails on Rackhub

Description:

This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.

Installation:

Please make sure that your Gemfile in your rails application includes unicorn.

@ymkjp
ymkjp / tenkaichi-git.md
Created November 22, 2012 14:59 — forked from teppeis/tenkaichi-git.md
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
" neobundle"{{{
filetype plugin indent off " required!
" initialize"{{{
if has('vim_starting')
let bundle_dir = '~/.bundle'
if !isdirectory(bundle_dir.'/neobundle.vim')
call system( 'git clone https://github.com/Shougo/neobundle.vim.git '.bundle_dir.'/neobundle.vim')
endif
@mochiz
mochiz / gist:4736183
Last active April 16, 2023 03:56
rbenvとruby-buildでRuby環境を最新に保つ

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
@CLCL
CLCL / CentOS6-L2TP-IPsec.md
Last active September 26, 2022 18:21
L2TP/IPsec(AndroidやiPhoneからのVPN接続)を経路を用意すべくVPSにL2TP/IPsecサーバを設置するとき、ネットにある情報だとなかなかつながらないから、標準環境としてAWSのCentOS 6.3 x86_64 Release Media(ami-3fe8603e)の起動直後から最短距離で設定する方法をまとめた。

CentOS 6でとにかくL2TP/IPsecサーバ

  • AWSでEC2のインスタンスを借りる
  • 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
  • Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可
  • ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:54.249.173.214)にrootでログイン

SELinuxを無効にする

[root@ip-10-132-164-105 ~]# setenforce 0

モダンなモジュラー

高度に分離し、モジュール化された異なる機能を組み合わせてできるアプリケーションのことをモジュラーという

一部に加えた変更による他の部分への影響がきわめてわかりやすくなるので、疎結合化を行うと依存関係が減りメンテナンス性が向上する

今のJavaScriptのイテレーションであるECMA-262では、モジュールのコードをインポートする方法は提供されていない

今までに学んだモジュールパターン、オブジェクトリテラルパターンに頼るのも良いが、名前の衝突を招く可能性がある

@megazalrock
megazalrock / RndText.js
Created February 18, 2014 15:24
ランダム文字列の取得(日本語対応)
var RndText = function(){
this.strCodes = {
ja : [
{ //hiragana
start: 0x3041,
end: 0x309f
},
{ //katakana
start: 0x30a0,
end: 0x30ff
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end