Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / understanding_systemd_boot_execution_graph.md
Created October 5, 2021 14:56 — forked from CMCDragonkai/understanding_systemd_boot_execution_graph.md
Understanding systemd Boot Execution Graph #systemd
@shoemoney
shoemoney / http_streaming.md
Created October 5, 2021 14:53 — forked from christianromney/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

#!/usr/bin/env bash
set -o pipefail
slow_compute_hash() {
find "$1" -type f -exec md5sum {} \; | sort -k 2 | md5sum
}
fast_compute_hash() {
find "$1" -type f -print0 | sort -z | xargs -0 md5sum | md5sum
}
@shoemoney
shoemoney / README.md
Created October 5, 2021 10:42 — forked from socheatsok78/README.md
lnav — Laravel Log Formatter

Laravel Log Formatter for Lnav


Installation

lnav -i https://gist.github.com/80d1d179c5706f85b281a5558217a5fe.git
# or
lnav -i [email protected]:80d1d179c5706f85b281a5558217a5fe.git

Usage

@shoemoney
shoemoney / alpinejs-tab-image.blade.php
Created September 12, 2021 19:33 — forked from umutyerebakmaz/alpinejs-tab-image.blade.php
Example of Tab Component made using AlpineJS only
<div x-data="{ openTab: 1 }" class="flex flex-col-reverse">
<div class="hidden mt-6 w-full max-w-2xl mx-auto sm:block lg:max-w-none">
<div class="grid grid-cols-4 gap-6" aria-orientation="horizontal" role="tablist">
@foreach ($product->productImages as $productImage)
<button x-on:click="{ openTab = {{ $loop->iteration }} }" id="tabs-1-tab-{{ $loop->iteration }}"
class="relative h-24 bg-white rounded-md flex items-center justify-center text-sm font-medium uppercase text-gray-900 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring focus:ring-offset-4 focus:ring-opacity-50"
aria-controls="tabs-1-panel-{{ $loop->iteration }}"
:tabindex="openTab === {{ $loop->iteration }} ? 0 : -1"
:aria-selected="openTab === {{ $loop->iteration }} ? 'true' : 'false'"
role="tab"
@shoemoney
shoemoney / youtube_format_code_itag_list.md
Created August 25, 2021 18:59 — forked from sidneys/youtube_format_code_itag_list.md
YouTube video stream format codes itags

YouTube video stream format codes

Comprehensive list of YouTube format code itags

itag Code Container Content Resolution Bitrate Range VR / 3D
5 flv audio/video 240p - - -
6 flv audio/video 270p - - -
17 3gp audio/video 144p - - -
18 mp4 audio/video 360p - - -
22 mp4 audio/video 720p - - -
@shoemoney
shoemoney / youtube.js
Created August 21, 2021 20:11 — forked from semihkeskindev/youtube.js
get Youtube Video Id from Url
// function
function getYoutubeUrlId (url) {
const urlObject = new URL(url);
let urlOrigin = urlObject.origin;
let urlPath = urlObject.pathname;
// Örneğin url https://youtu.be/V-uynt7UXXI ise
if (urlOrigin.search('youtu.be') > -1) {
// substr yapma sebebimiz, youtube kısaltma linklerinde id path'de olur ve pathname başında "/" olur.
// Örneğin "/V-uynt7UXXI" ise "V-uynt7UXXI" return eder.
@shoemoney
shoemoney / NewMessage.php
Created August 11, 2021 23:55 — forked from sebastiaanluca/NewMessage.php
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{
@shoemoney
shoemoney / db_backup.sh
Created August 4, 2021 04:47 — forked from pantoniotti/db_backup.sh
Database Backup script
#!/bin/bash
### MySQL Server Login Info ###
MUSER="root"
MPASS="root_password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/path/to/export"
# USE THIS CODE TO BACKUP ONLY ONE SPECIFIC DB
@shoemoney
shoemoney / jq_examples.md
Created May 26, 2021 03:50 — forked from johntoups/jq_examples.md
aws-cli + jq