A quick guide on how to setup Node.js development environment.
Previous versions of these install instructions had been tested with:
Install rvm: | |
1. $gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
2. curl -sSL https://get.rvm.io -o rvm.sh | |
3. source ~/.rvm/scripts/rvm | |
4. rvm install ruby --default |
var https = require('https'); | |
// CONFIGURATION ####################################################################################################### | |
var token = 'SLACK TOKEN'; | |
var channel = 'CHANNEL ID'; | |
var privateChannel = false; | |
var delay = 300; // delay between delete operations in millisecond | |
// GLOBALS ############################################################################################################# |
Format datetime by Carbon: | |
1. setlocale(LC_TIME, 'ja_JP.utf8'); | |
2. $value->formatLocalized('%Y/%-m/%d (%a) %H:%M') (Ex: 2018/4/15 (日) 20:47) | |
Note: | |
- Month without leading zero: %-m |
use Illuminate\Validation\ValidationException; | |
use Illuminate\Contracts\Validation\Validator; | |
use Illuminate\Http\Exceptions\HttpResponseException; | |
/** | |
* Handle a failed validation attempt. | |
* | |
* @param \Illuminate\Contracts\Validation\Validator $validator | |
* @return void | |
* |
A quick guide on how to setup Node.js development environment.
Previous versions of these install instructions had been tested with:
let a = 10, b = 12; | |
[a, b] = [b, a]; |
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Process; | |
use Symfony\Component\Process\Exception\ProcessFailedException; | |
class BackUpDatabase extends Command | |
{ |
/.composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
--rules=@PSR2 --verbose fix $FileDir$/$FileName$
. Note that previous verions of PHP-CS-Fixer used --levels
instead of --rules
.$ProjectFileDir$
Click OK and Apply. Now we'll set up a shortcut.
ctrl + cmd + ]
:$ cd ~ | |
$ sudo curl -sS https://getcomposer.org/installer | sudo php | |
$ sudo mv composer.phar /usr/local/bin/composer | |
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
then you can run | |
$ sudo composer install |
[Unit] | |
Description=Job that runs the python SimpleHTTPServer daemon | |
Documentation=man:SimpleHTTPServer(1) | |
[Service] | |
Type=simple | |
WorkingDirectory=/tmp/letsencrypt | |
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 & | |
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'` |