Skip to content

Instantly share code, notes, and snippets.

View Sammyjo20's full-sized avatar
🔭
Stargazing

Sam Sammyjo20

🔭
Stargazing
  • EU-WEST-2
View GitHub Profile
@ejntaylor
ejntaylor / SignAwsRequest.php
Last active December 5, 2023 12:17
Middleware to sign lambda requests
<?php
namespace App\Http\Integrations\Middleware;
use Aws\Credentials\CredentialProvider;
use Aws\Credentials\CredentialsInterface;
use Aws\Signature\SignatureV4;
use Saloon\Contracts\RequestMiddleware;
use Saloon\Http\PendingRequest;
@sebastiaanluca
sebastiaanluca / CarbonImmutableCaster.php
Last active March 24, 2024 14:39
Lazy Laravel Harvest API service
<?php
declare(strict_types=1);
namespace App\DataTransferObjects;
use Carbon\CarbonImmutable;
use Spatie\DataTransferObject\Caster;
class CarbonImmutableCaster implements Caster
@codepotato
codepotato / deploy.sh
Last active October 6, 2021 20:45
Simplify deployments with Lasso and Laravel
echo "--------------------------------------"
echo "==> Lasso that shizzle"
echo "--------------------------------------"
php artisan lasso:publish
echo "--------------------------------------"
echo "==> Adding the created json to GIT"
echo "--------------------------------------"
git add -A
git commit -m "Updated assets wrangled 🤠"
@calebporzio
calebporzio / artisan_db_open.php
Last active May 15, 2024 05:48
An artisan command for opening the project's database in TablePlus
<?php
Artisan::command('db:open {connection?}', function ($connection = null) {
if (! file_exists('/Applications/TablePlus.app')) {
$this->warn('This command uses TablePlus, are you sure it\'s installed?');
$this->line("Install here: https://tableplus.com/\n");
}
$driver = $connection ?: config('database.default');
$host = config("database.connections.{$driver}.host");
@codepotato
codepotato / bash.sh
Created November 22, 2019 10:04
Remove all git repos that have already been merged with origin
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin
@winuxue
winuxue / puppeteer-ubuntu-1804.md
Created May 22, 2019 01:15
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1
@Dammmien
Dammmien / wget.sh
Last active June 12, 2024 13:29
wget cheat sheet
# POST a JSON file and redirect output to stdout
wget -q -O - --header="Content-Type:application/json" --post-file=foo.json http://127.0.0.1
# Download a complete website
wget -m -r -linf -k -p -q -E -e robots=off http://127.0.0.1
# But it may be sufficient
wget -mpk http://127.0.0.1
# Download all images of a website