Skip to content

Instantly share code, notes, and snippets.

View eskayamadeus's full-sized avatar
🖥️
Tinkering.

Elikem Seake-Kwawu eskayamadeus

🖥️
Tinkering.
View GitHub Profile
@LaurenceRawlings
LaurenceRawlings / Laravel Sail Setup.md
Last active October 9, 2024 10:18
Setup Laravel Sail from source control

Laravel Sail Setup

This is a simple script along with some useful information to help when setting up a Laravel Sail project that was cloned from source control. I made this because I could not find anywhere that explained how to do this and kept running into problems. The main issue was a problem with database authentication. It turns out that when the Docker volume is created for the database for the first time the password that is in the .env file is used, which I usually created after starting Sail for the first time. Another issue was not having access to the Sail binary to start the containers. This is solved by the script by installing the composer dependencies with a disposable container. If you follow the steps below in order you should not run into any issues. Feel free to leave a comment on this Gist if it could be improved.

How to use

@yimity
yimity / disable-web-security
Created February 13, 2020 13:55
disable-web-security
open -a "Google Chrome" --args --disable-web-security --user-data-dir
open -a "Microsoft Edge" --args --disable-web-security --user-data-dir
@cp6
cp6 / pdo_examples.php
Last active July 4, 2023 22:04
PHP PDO MySQL cheat sheet
<?php
//Create connection
$db = new PDO('mysql:host=localhost;dbname=DATABASENAME;charset=utf8mb4', 'USERNAME', 'PASSWORD');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);//https://www.php.net/manual/en/pdo.setattribute.php
//Check connection status
echo $db->getAttribute(PDO::ATTR_CONNECTION_STATUS);
//SELECT with loop
$select = $db->prepare("SELECT `col`, `col2` FROM `table`");
@bradtraversy
bradtraversy / pdocrash.php
Last active January 31, 2025 15:50
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance
@subfuzion
subfuzion / curl.md
Last active April 16, 2025 09:14
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@sposmen
sposmen / README.md
Created April 14, 2014 15:02
How to create a new repository from an specific branch

How to create a new repository from an specific branch

ORIGINAL: Original repository directory

NEW_REPO: New reposotory directory

OLD_BRANCH: Branch which you want to be the master on NEW_REPO

  1. Clone ORIGNAL from branch that you want to clone
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote