Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / .screenrc
Created September 24, 2021 09:41
My basic mac screenrc
escape ^Z^\
vbell off
# don't show startup messages
startup_message off
# detach on hangup - if my dial-up session fails, screen will simply
# detach and let me re re-attach later.
autodetach on
@shoemoney
shoemoney / amazon-linux-instance-connect.sh
Created September 24, 2021 09:37
Easy connect ssh to any of your ec2 instances
#!/bin/bash
# simple shell script to demonstrate how EC2 Instance Connect CLI is implemented.
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html
#
# Usage
# $ bash eic-cli.sh i-1234
if [ $# -ne 1 ]; then
echo "Usage"
echo "$ bash eic-cli.sh i-1234"
@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 / gist:261ce9bbc4848efd0b3be31604cbcec4
Created July 5, 2021 18:40
Bash Script to install latest VIM with Python 3 support
cd /tmp || exit
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz && cd Python* && ./configure --enable-optimizations --enable-shared && make && make install
echo 'export LD_LIBRARY_PATH="/usr/local/lib' >>.zshrc
cd /tmp || exit
[ -d /tmp/vim ] || sudo rm -Rf vim && sudo git clone https://github.com/vim/vim.git
@shoemoney
shoemoney / jq_examples.md
Created May 26, 2021 03:50 — forked from johntoups/jq_examples.md
aws-cli + jq
@shoemoney
shoemoney / metrics.json
Created May 10, 2021 16:31 — forked from rawkode/metrics.json
Envoy Metrics
{
"stats": [{
"name": "access_log_file.flushed_by_timer",
"value": 0
}, {
"name": "access_log_file.reopen_failed",
"value": 0
}, {
"name": "access_log_file.write_buffered",
"value": 0