This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| echo "Hello,World"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/https' | |
| require 'uri' | |
| require 'json' | |
| client_id = '' | |
| client_secret = '' | |
| topic_id = '' | |
| msg = 'Hello!' | |
| # setup a http client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user|~]$ cd /etc/nginx/conf.d/ | |
| [user|conf.d]$ sudo vi xxx.conf #xxxは自分のアプリケーション名でファイル名変更 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| field = [[1,2],[3,4]] | |
| # 連結 | |
| # 12 | |
| # 34 | |
| field.each { |f| puts f.join("")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array = [nil, 1, 2, 3, nil] | |
| # nilを削除して計算 | |
| p array.compact.inject(&:+) # 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $keyword_uppercase = 'XYZ'; | |
| $keyword_lowercase = 'xyz'; | |
| $text1 = 'abcXYZ'; | |
| $text2 = 'abcXYZabcXYZ'; | |
| // mb_strposの挙動 | |
| // 大文字は文字は含まれていると判定される |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $keyword_uppercase = 'XYZ'; | |
| $keyword_lowercase = 'xyz'; | |
| $text1 = 'abcXYZ'; | |
| // mb_striposの挙動 | |
| // 大文字は文字は含まれていると判定される | |
| if (mb_stripos($text1, $keyword_uppercase) === false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // mbstrposの誤判定 | |
| $keyword2 = 'DEF'; | |
| $text2 = 'DEFghi'; | |
| // 含まれていないと判定される | |
| // mb_strposの戻り値が'0'の場合、誤判定するため | |
| // mb_strposの判定は'==='で行うこと | |
| if (mb_strpos($text2, $keyword2) == false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The difference between the request time and the current time is too large. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo apt-get update | |
| $ sudo apt-get install postgresql-9.5 | |
| パッケージリストを読み込んでいます... 完了 | |
| 依存関係ツリーを作成しています | |
| 状態情報を読み取っています... 完了 | |
| E: パッケージ postgresql-9.5 が見つかりません | |
| E: 正規表現 'postgresql-9.5' ではパッケージは見つかりませんでした |
OlderNewer