Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / checkifempty.bash
Created October 2, 2021 11:06
Bash compare operators
Check if empty
if [ -z "$var" ]
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi
OR
@shoemoney
shoemoney / install_latest_nodejs_amazon_linux_2.sh
Created September 27, 2021 13:04
install latest nodejs on amazon linux 2 and no stupid issues
sudo yum install gcc-c++ make
sudo curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install -y nodejs
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn
@shoemoney
shoemoney / ec2makeswap.sh
Created September 27, 2021 12:49
Create Swap Partition and Activate On Amazon Linux 2
#first create the file this will make a 4gb file. do 20 count for 2gb etc..
sudo dd if=/dev/zero of=/swapfile bs=128M count=32
chmod 600 /swapfile
#format the file properly with mkswap
sudo mkswap /swapfile
#tell your system to activate it
swapon /swapfile
#test swap file
swapon -s
#if no errors add to fstab so it auto mounts:
@shoemoney
shoemoney / amzningx.sh
Created September 25, 2021 01:15
Amazon Linux 2 - Because other installs suck. This is a work in progresss
enable amazon-linux-extras
enable epel extras
adduser nginx
update yum
upgrade yum
##get katest nginx
cd /tmp/
@shoemoney
shoemoney / pro-machine-learning.md
Created September 24, 2021 09:47
Guide to become pro at machine learning

Everything You Need To Become A Machine Learner

Part 1:

Everything You Need To Become A Machine Learner

Part 1:

*This list of resources is specifically targeted at Web Developers and Data Scientists…. so do with it what you will…* > *This list borrows heavily from multiple lists created by :* sindresorhus Machine learning is a subfield of artificial intelligence, which is broadly defined as the capability of a machine to imitate intelligent human behavior. Artificial intelligence systems are used to perform complex tasks in a way that is similar to how humans solve problems. > *The goal of AI is to create computer models that exhibit “i
@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.