Skip to content

Instantly share code, notes, and snippets.

View satomixx's full-sized avatar

Satomi Suyama satomixx

View GitHub Profile
@satomixx
satomixx / confirm
Created January 30, 2014 11:54
JavaScriptで、ブラウザデフォルトの確認ダイアログを使う方法 ref: http://qiita.com/mugyuu/items/4331bb6dedc2d76fc8e6
function confirmPugyaa(msg,target){
if(window.confirm(target + "さんに" + msg + "します。\nよろしいですか?\n")){
return true;
}else{
return false;
}
}
@satomixx
satomixx / file0.txt
Created February 5, 2014 07:31
シンボリックリンクの作成と削除 ref: http://qiita.com/mugyuu/items/2e99304bd92201261c60
hoge# ln -s /hoge/fuga/watshi ./watashi
もしくは
hoge# ln -s /hoge/fuga/watshi watashi
また、もし同じ名前でいいのなら、
hoge# ln -s /hoge/fuga/watshi
@satomixx
satomixx / file3.txt
Created February 6, 2014 07:23
Perlで2つの配列の要素から重複を排除する、重複した要素だけ抽出する ref: http://qiita.com/mugyuu/items/f5d825c5214a7848305a
hoge# perl make_array_unique .pl
6
2
8
4
10
@satomixx
satomixx / file0.txt
Created March 27, 2014 09:17
MacOSX Mavericks にアップデート後、環境を整え、 heroku を利用できる様にする ref: http://qiita.com/mugyuu/items/0009b3efda0fb94d40cd
hoge% xcode-select --install
@satomixx
satomixx / file0.txt
Created March 28, 2014 05:39
さくらVPSでFTPを使える様にした ref: http://qiita.com/tsumekoara/items/11382273624621f3caee
$ yum install vsftpd
@satomixx
satomixx / AppShell.php
Created April 11, 2014 06:07
[CakePHP 2.x] shell(シェル)からComponent(コンポーネント)を呼び出す ref: http://qiita.com/tsumekoara/items/d302cc0eeec3adc18456
<?php
App::uses('Shell', 'Console');
class AppShell extends Shell {
}
@satomixx
satomixx / AsagohanComponent.php
Created April 22, 2014 07:25
[CakePHP 2.x] ComponentでConstructorを使う、ついでにShellからComponentを使うまとめ ref: http://qiita.com/tsumekoara/items/c91533c95b8132c9db8f
<?php
App::uses('Component', 'Controller');
class AsagohanComponent extends Component {
const BURNER_ACCESSKEY = "hidarihajinaraok";
const BURNER_SECRETKEY = "jikkurimawasu";
const BURNER_REGION = "hidarihaji";
private $_ochawan;
@satomixx
satomixx / file0.txt
Created October 8, 2014 04:18
[Rails 4.x] エラーページの作り方 ref: http://qiita.com/tsumekoara/items/88815b94f63608a801a8
module ErrorHandlers
extend ActiveSupport::Concern
included do
rescue_from Exception, with: :rescue500
rescue_from ApplicationController::Forbidden, with: :rescue403
rescue_from ApplicationController::IpAddressRejected, with: :rescue403
rescue_from ActionController::RoutingError, with: :rescue404
rescue_from ActiveRecord::RecordNotFound, with: :rescue404
end
@satomixx
satomixx / maker.rb
Last active August 29, 2015 14:07
[Rails 4.x] ActiveAdmin をカスタマイズして、indexやshowでassociation関係のテーブルのカラムも表示させる ref: http://qiita.com/tsumekoara/items/84f87fb8bd85f625129e
class Maker < ActiveRecord::Base
has_many :products
end
@satomixx
satomixx / file0.txt
Created November 27, 2014 07:30
[Rails 4.x] Rails アプリをWerckerを通してHerokuに上げる際に -bash: heroku: command not found とかなった場合の対応。 ref: http://qiita.com/tsumekoara/items/62cfa777b108acb5659f
$ heroku run:detached rake db:migrate --app $APP_NAME
-bash: heroku: command not found