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
| // PhpOffice\PhpSpreadsheetをロード | |
| require './vendor/autoload.php'; | |
| // 既存のブックを読み込む | |
| $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load("base.xlsx"); | |
| $sheet = $spreadsheet->getSheetByName("Sheet1"); | |
| // 中身をなんらか変更 | |
| $sheet->setCellValue('B2', "This is it"); |
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
| /** | |
| * https://qiita.com/unbabel/items/12487e85525ba1ec1618の改良版 | |
| */ | |
| function replaceDate(dateStr) { | |
| const regexp = /^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9])(?: ([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/; | |
| return dateStr.replace(regexp, (match, year, month, day, hour, minutes, seconds) => { | |
| console.log(hour); | |
| if (!hour) { | |
| return `${year}-${month}-${ day}T00:00:00.000+09:00`; | |
| } else { |
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 OFF | |
| REM 参考) 遅延環境変数を有効に | |
| REM https://qiita.com/sawa_tsuka/items/c7c477cacf8c97792e17 | |
| SETLOCAL enabledelayedexpansion | |
| REM 参考) バッチファイルで、世代管理をしつつバックアップを取る | |
| REM https://qiita.com/kumasun/items/24d0d855e084ce8ec856 | |
| REM ***** 各種設定 ***** |
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 | |
| // mecabのインスタンスを生成 | |
| $options = ['-d', '/usr/lib64/mecab/dic/mecab-ipadic-neologd/']; | |
| $mecab = new MeCab_Tagger($options); | |
| // サンプル文字列 | |
| $str = 'あるがままの心で生きられぬ弱さを'; | |
| $str = '魔法少女まどか☆マギカ、が1つの固有名詞として判断されていたらOk'; | |
| $str = 'これってももクロとかアイマスとかどうなんでしょうね…?'; |
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 off | |
| rem ###################################################################### | |
| rem プログラム:指定した日付以降の更新ファイルのみ抽出するバッチ | |
| rem ###################################################################### | |
| rem ----------------------------------------------------------------- |
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
| var sprintf = function(fmt, a) | |
| { | |
| var rep_fn = undefined; | |
| if (typeof a == "object") { | |
| rep_fn = function(m, k) { return a[ k ]; } | |
| } | |
| else { | |
| var args = arguments; | |
| var i = 1; |
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 | |
| class Model extends AppModel { | |
| public $validate = array( | |
| 'fieldname' => array( | |
| // | |
| 'notEmpty' => array( | |
| 'rule' => array('notEmpty'), | |
| 'message' => 'A fieldname is required', |
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 | |
| $query = $_GET['str']; | |
| if ($query) { | |
| $salt = sha1($query); | |
| $seed = ''; | |
| for ($i = 0; $i < 30; $i++) { | |
| $seed .= mt_rand(0, 9); |