- Shall i implement it?
- No ...
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
| $client = new Client(); | |
| $array = []; | |
| $res = $client->request('POST', $url, [ | |
| 'body' => json_encode($array), | |
| 'headers' => [ | |
| 'Content-Type' => 'application/json', | |
| ] | |
| ]); |
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
| const crypto = require('crypto') | |
| const sha1 = path => new Promise((resolve, reject) => { | |
| const hash = crypto.createHash('sha1') | |
| const rs = fs.createReadStream(path) | |
| rs.on('error', reject) | |
| rs.on('data', chunk => hash.update(chunk)) | |
| rs.on('end', () => resolve(hash.digest('hex'))) | |
| }) |
The easiest way to get the ClamAV package is using Homebrew
$ brew install clamav
Before trying to start the clamd process, you'll need a copy of the ClamAV databases.
Create a freshclam.conf file and configure as so
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
| # Laravel queue worker using systemd | |
| # ---------------------------------- | |
| # | |
| # /lib/systemd/system/queue.service | |
| # | |
| # run this command to enable service: | |
| # systemctl enable queue.service | |
| [Unit] | |
| Description=Laravel queue worker |
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 | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| class EnsureQueueListenerIsRunning extends Command | |
| { | |
| /** | |
| * The name and signature of the console command. |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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
| class Hash | |
| def to_html | |
| [ | |
| '<ul>', | |
| map { |k, v| ["<li><strong>#{k}</strong>", v.respond_to?(:to_html) ? v.to_html : "<span>#{v}</span></li>"] }, | |
| '</ul>' | |
| ].join | |
| end | |
| end |