jQuery

ツール フォーム入力関係 セレクタ 前方, 部分、後方一致 イベントハンドラ on : 動的な要素に対しても追加可能(https://app.codegrid.net/entry/practical-jquery-1) hover: mouseenterとmouseleaveのエイリアス( http://h2ham.seesaa.net/article/242553044.html ) ドラッグ https://johnny.github.io/jquery-sortable/

2015年8月7日 · 1 分

doctrine ORM

$ ./composer.phar require doctrine/orm 2.4.* ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing doctrine/collections (dev-master 3661cd8) Cloning 3661cd8bc5152598dbe6772e98b78d1fa8281a67 - Installing doctrine/cache (dev-master e7b77e5) Cloning e7b77e5abe230a2cc1db5005fb86435da213ae3b - Installing doctrine/inflector (dev-master b0b2fef) Cloning b0b2feffb47906a03b570777c07044c529d1d124 - Installing doctrine/common (2.5.x-dev 26727ba) Cloning 26727ba78de21a824dcbfa5a8ab52c21fe7d71d5 - Installing doctrine/dbal (dev-master cc2d503) Cloning cc2d50385efa1ea87f5d0afa2c47cc2499914f81 - Installing doctrine/orm (2.4.x-dev 0cf7e0e) Cloning 0cf7e0e628c1409c9235c9b107c9623a2e8a80ef doctrine/orm suggests installing symfony/yaml (If you want to use YAML Metadata Mapping Driver) Writing lock file Generating autoload files

2015年8月6日 · 1 分

MySQL

[intrinsic column flags] - PK: primary key (column is part of a pk) - NN: not null (column is nullable) - UQ: unique (column is part of a unique key) - AI: auto increment (the column is auto incremented when rows are inserted) [additional data type flags, depend on used data type] - BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text) - UN: unsigned (for integer types, see docs: "10.2. Numeric Types") - ZF: zero fill (rather a display related flag, see docs: "10.2. Numeric Types") MySQLでログを出力してみる ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option ‘secure_auth’ enabled) MySQLのバージョンがちがうとパスワードハッシュが違うのでログインできなくなる

2015年8月5日 · 1 分

PHP

もろもろ 文字数とか PHPでの文字列の文字数・バイト数・文字幅(見た目の長さ)の数え方 全角チェック 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <?php /** * @assert ('文字列です。') === true * @assert ('abcd1234+:;!') === false * @assert ('全角abcd') === false * @assert ('半角カナ') === false */ function is_zen_preg_match ($str) { if (!preg_match("/(?:\xEF\xBD[\xA1-\xBF]|\xEF\xBE[\x80-\x9F])|[\x20-\x7E]/", $str)) { return true; } else { return false; } } 名前でメソッドを呼ぶ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 <?php class Checker { function check_name($value) { return false; } } $profile = array( 'name' => 'my name', 'phone' => '333-3333-3333' ); $checker = new Checker(); function check($checker, $key, $value ){ $method = "check_$key"; if(method_exists($checker, $method)){ return $checker->$method($value); } return true; } foreach($profile as $key => $value ){ echo $key, ":", check($checker, $key, $value ), "\n"; } map関数 1 2 3 4 5 6 7 8 9 10 11 12 13 <?php $array = array('a' => 1, 'b' => 2, 'c' => 3); $array2 = array_map(function($val){ return $val * 2 ; }, $array); foreach($array as $k => $v ){ echo "$k .... $v\n"; } foreach($array2 as $k => $v ){ echo "$k .... $v\n"; } 1 2 3 4 5 6 7 $ php tests_map.php a .... 1 b .... 2 c .... 3 a .... 2 b .... 4 c .... 6 インスタンスクラスのstatic メンバーへのアクセス 1 2 3 $model_class = get_class($instance); $value = $model_class::$static_value; 配列要素の削除 1 unset($array[$i]); PHP docs PHP: Noticeエラーを回避してarrayから値を取得するいくつかの例 mysql -接続確認 ...

2015年8月5日 · 2 分

CentOS

$ sudo yum install graphviz-python graphviz-devel $ pip install pygraphviz

2015年8月4日 · 1 分

Mac

2017 購入 Macbook Pro 13 (A1706) シェルケース

2015年8月4日 · 1 分

Laravel - Laravel PHP Framework

laravel.jp

2015年8月3日 · 1 分

Test

Nose noseで気軽にテストを書く(+geventの場合) https://github.com/django-nose/django-nose Django でのテスト BDD Behave Lettuce Scripting Selenium

2015年8月3日 · 1 分

Geolocation

Google Maps API googlemaps/google-maps-services-python Google Geocoding API で住所から緯度経度を求める

2015年8月1日 · 1 分

PowerShell

PowerShell 実行権限 WindowsでPowerShellスクリプトの実行セキュリティポリシーを変更する PS C:\WINDOWS\system32> Get-ExecutionPolicy RemoteSigned PS C:\WINDOWS\system32> Set-ExecutionPolicy Unrestricted Set-ExecutionPolicy : Windows PowerShell により実行ポリシーは正常に更新されましたが、設定は範囲がより明確に定義されたポリシーで上書きされました。この上書きにより、シェルで現在有効な実行ポリシー RemoteSigned が保持されます。 実行ポリシーの設定を表示するには、「Get-ExecutionPolicy -List」と入力してください。詳細については、"Get-Help Set-ExecutionPolicy" を参照してください。 発生場所 行:1 文字:1 + Set-ExecutionPolicy Unrestricted + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException + FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand PS C:\WINDOWS\system32> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser RemoteSigned LocalMachine Unrestricted How successfully change Execution policy and enable execution of Powershell scripts ...

2015年8月1日 · 1 分