Skip to content

Instantly share code, notes, and snippets.

(function(win, doc, $) {
"use strict";
$(function(){
// フォーム多重送信防止処理
//
// ※全てのフォームに適用ではなく、「設定した」フォームに適用する方針で実装する
// *POSTでの遷移が多いため、ブラウザバックで戻った際、意図してない動作が発生すると推測したため
//
// 設定方法
@tikitikipoo
tikitikipoo / gist:8276973
Last active January 2, 2016 08:29
vagrant upで共有フォルダがマウント失敗 guest additionのバージョンが異なることでおこるようだ。 vagrant plugin install vagrant-vbguestで解決
[my@my-no-MacBook-Air-2 something]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
- TotalTerminal
環境設定
1. -> 設定 -> Pro デフォルト
2. -> 設定 -> テキスト -> フォント -> Monaco 14 pt
3. -> TotalTerminal -> Activation -> Command + @
PHPのインストールは手動で行った。
phpenv + php-build + phpenv-apache-version
参考
http://blog.masu-mi.me/2013/11/23/construct_php_env.html
@tikitikipoo
tikitikipoo / gist:6060384
Last active December 20, 2015 02:59
knife (solo) チートシート
vagrantでのテストをする場合
cd /some/where
vagrant init
vagrant ssh-config --host <some-hostname> >> ~/.ssh/config
vagrant up
Chefリポジトリを作成
knife solo init <chef-repo-name>
@tikitikipoo
tikitikipoo / gist:5765124
Last active December 18, 2015 09:59
一つのディレクトリにまとめる
#/bin/sh
IFS="
"
# 指定ディレクトリに移動する関数
cp_file(){
srcDir=$1
dstDir=$2
# 移動元ディレクトリの存在確認
キャンバス型アプリ
Facebookへのヘッダやサイドバーがついた状態で実行されるWebアプリケーション。アプリ提供者のサーバから出力されるHTMLは、Facebookのインラインフレーム(iframe)の中で表示される。
独立型アプリ
プログラムのデザインやインターフェースなどの外見からはFacebookと一件無関係に見えますが、Facebookアカウントを使用したログインやウォールへの書き出し機能などを持ったWebアプリケーション
ネイティブアプリ
Facebook APIを使用したスマートフォン各機種専用のアプリ
タブ型アプリ
App::uses('CakeEmail', 'Network/Email');
class DummyEmail
{
private $Email;
public function __construct($Email)
{
$this->Email = $Email;
$env = env('APP_ENV');
# 使わせていただきます https://github.com/binarylogic/authlogic/blob/master/lib/authlogic/regex.rb
# user idの正規表現
# A simple regular expression that only allows for letters, numbers, spaces, and .-_@. Just a standard login / username
# regular expression.
def self.login
/\A\w[\w\.+\-_@ ]+\z/
end
@tikitikipoo
tikitikipoo / gist:4688544
Created February 1, 2013 01:54
CakePHP Behat 表示されるべき個数をテストしたいとき
$steps->Given('/^"([^"]*)" が (\d+) 個表示されていること$/', function($world, $text, $num) {
$actual = $world->getSession()->getPage()->getContent();
$regex = '/'.preg_quote($text, '/').'/u';
$result = preg_match_all($regex, $actual, $matches);
if (!$result) {
$message = sprintf('The text "%s" was not found anywhere in the text of the current page.', $text);
throw new \Exception($message, E_USER_ERROR);
}