Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / sources.list
Created October 13, 2023 14:21 — forked from hakerdefo/sources.list
Debian 12 "bookworm" complete sources.list
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
@shoemoney
shoemoney / nginx-tuning.md
Created February 18, 2022 07:16 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

Everything You Need To Become A Machine Learner

Part 1:


Everything You Need To Become A Machine Learner

Part 1:

@umutyerebakmaz
umutyerebakmaz / alpinejs-tab-image.blade.php
Created September 2, 2021 13:45
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.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 / octane-on-forge.md
Created April 12, 2021 08:24 — forked from viezel/octane-on-forge.md
Quickly get Octane running on Laravel Forge

Quickly get Octane running on Laravel Forge

  1. Spin up a new App server, choose PHP 8
  2. SSH into it and run sudo -i to become root
  3. Run pecl install swoole and enable what you need. (I disabled curl as it did not work for me)
  4. Add a new Site to your server and use git to pull in your Laravel project that has Octane installed.
  5. Point your DNS to your new site
  6. Enable SSL using Lets Encrypt
  7. Change your new Sites Nginx settings to (assuing your site is named octane.example.com):
@viezel
viezel / octane-on-forge.md
Last active December 16, 2023 21:57
Quickly get Octane running on Laravel Forge

Quickly get Octane running on Laravel Forge

  1. Spin up a new App server, choose PHP 8
  2. SSH into it and run sudo -i to become root
  3. Run pecl install swoole and enable what you need. (I disabled curl as it did not work for me)
  4. Add a new Site to your server and use git to pull in your Laravel project that has Octane installed.
  5. Point your DNS to your new site
  6. Enable SSL using Lets Encrypt
  7. Change your new Sites Nginx settings to (assuing your site is named octane.example.com):
@binaryweavers
binaryweavers / AnyLivewireComponent.php
Last active April 22, 2021 06:54
Fluent toaster(alerts) for laravel/livewire using alpinejs and tailwindcss
public function showToasters(){
// default info toaster with timeout
$this->toaster('your message');
// makes it persistent
$this->toaster('your message')->persistent();
// warning toaster with timeout
$this->toaster('your message')->warning();
@shoemoney
shoemoney / upload-s3-webpack.mix.js
Created February 10, 2021 18:59 — forked from avosalmon/upload-s3-webpack.mix.js
Upload assets to S3 using Laravel Mix
const mix = require('laravel-mix');
const s3Plugin = require('webpack-s3-plugin');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
@shoemoney
shoemoney / git-pull-recursive.rb
Created October 12, 2020 09:10 — forked from jonpugh/git-pull-recursive.rb
Lots of repos? Try "git-pull-recursive" to run "git pull" on all subfolders with a .git folder inside. Thanks to http://snipplr.com/view/62314/perform-git-pull-on-subdirectory-recursive/
# For use in Chef:
# Adds a command: git-pull-recursive
file "/usr/local/bin/git-pull-recursive" do
owner "root"
group "root"
mode "0755"
action :create
content 'find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;'
end