Skip to content

Instantly share code, notes, and snippets.

View thehypergraph's full-sized avatar
💭
Sit rep normal

Ronald Jordan thehypergraph

💭
Sit rep normal
View GitHub Profile
@achmadfatoni
achmadfatoni / guzzle_raw_post_request.php
Created August 29, 2017 09:21
Guzzle Raw POST request
$client = new Client();
$array = [];
$res = $client->request('POST', $url, [
'body' => json_encode($array),
'headers' => [
'Content-Type' => 'application/json',
]
]);
@F1LT3R
F1LT3R / sha1-hash-node.js
Created August 1, 2017 04:09
sha1 hash node.js
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')))
})
@subharanjanm
subharanjanm / clamav-mac.md
Created August 30, 2016 14:16 — forked from dkobia/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

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

@thomasjsn
thomasjsn / laravel-queue.service
Last active April 26, 2024 09:34
Laravel queue worker using systemd.
# 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
@ivanvermeyen
ivanvermeyen / EnsureQueueListenerIsRunning.php
Last active February 13, 2024 12:40
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

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

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