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
| # SSH into droplet | |
| # go to project | |
| $ php artisan tinker | |
| $ Mail::send('errors.401', [], function ($message) { $message->to('emmanuelbarturen@gmail.com')->subject('this works!'); }); | |
| Mail::raw('test', function ($message) {$message->subject('Тестовая тема');$message->from('test@test.com');$message->to('agoalofalife@gmail.com');}); | |
| # check your mailbox |
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
| // мощь js как функционального языка | |
| // паттерн pipline в действие | |
| // всего 5 строк кода | |
| const compose = (...fns) => | |
| (arg) => | |
| fns.reduce( | |
| (composed, f) => f(composed), | |
| arg ) |
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
| ```js | |
| let basePriceProduct = new basis.Token(0); | |
| // price up for some thing | |
| let priceUp = basePriceProduct.as(function(basePrice) { | |
| var priceUp = basePrice/100 * 10; | |
| return basePrice+priceUp; | |
| }) |
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
| // dump mysql with date and gzip master! | |
| mysqldump -u root -p databasename | gzip > `date '+%m-%y-%d %H:%M:%S'`.databasename.sql.gz | |
| // dump mysql with date and gzip master from remote server | |
| ssh root@00.000.000.00 "mysqldump -u username -p basename | gzip > ./`date '+%m-%y-%d-%H:%M:%S'`.basename.sql.gz" | |
| // with ignore table | |
| ssh root@00.000.000.00 "mysqldump -u username -p basename --ignore-table=database.table1" | gzip > ./`date '+%m-%y-%d-%H:%M:%S'`.basename.sql.gz |
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
| server { | |
| index index.php; | |
| server_name flarum.dev; | |
| error_log /var/log/nginx/error.log; | |
| access_log /var/log/nginx/access.log; | |
| root /var/www/flarum.dev; | |
| location / { try_files $uri $uri/ /index.php?$query_string; } | |
| location /api { try_files $uri $uri/ /api.php?$query_string; } | |
| location /admin { try_files $uri $uri/ /admin.php?$query_string; } |
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
| version: '2' | |
| services: | |
| nginx: | |
| image: nginx:latest | |
| ports: | |
| - "8010:80" | |
| - "442:443" | |
| volumes: | |
| - ./hosts:/etc/nginx/conf.d | |
| - ./www:/var/www |
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 | |
| use League\Pipeline\Pipeline; | |
| interface Registrator{} | |
| interface Notificator{} | |
| class Order implements Registrator,Notificator | |
| { | |
| protected $order; |
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 | |
| use League\Pipeline\Pipeline; | |
| class NumberHandler | |
| { | |
| public function __invoke($value) | |
| { | |
| if (gettype($value) == 'float') | |
| { |
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 | |
| interface Handler | |
| { | |
| public function handle($value, Closure $next); | |
| } | |
| // handler if the value | |
| class NumberHandler implements Handler | |
| { |
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
| Function.prototype.partial = function(){ | |
| var fn = this, args = Array.prototype.slice.call(arguments) | |
| return function(){ | |
| var arg = 0 | |
| for (var i = 0; i < args.length && arg < arguments.length; i++) { | |
| if(args[i] === undefined) { | |
| args[i] = arguments[arg++] | |
| return fn.apply(this, args) |
NewerOlder