Skip to content

Instantly share code, notes, and snippets.

@akoepcke
akoepcke / .bash_profile
Created August 31, 2018 08:11
composer-link()
// Require local folder as Composer dependency
// whereas _package_ is a unique package ID to keep composer from overwriting existing config
//
// from within the project folder, run the following:
// composer-link /path/to/package package
// Then run composer require as usual.
composer-link() {
composer config repositories."$2" '{"type": "path", "url": "'$1'"}' --file composer.json
}
@akoepcke
akoepcke / .php_cs.laravel.php
Created July 22, 2019 10:07 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
Files:
find /path/to/root -type f -exec chmod 644 {} \;
Folders:
find /path/to/root -type d -exec chmod 755 {} \;
.htaccess (because of Ionos)
modify RewriteRule ^ index.php
to RewriteRule ^ /index.php
@akoepcke
akoepcke / LoginController.php
Created August 27, 2019 07:38
migrate md5 to bcrypt
protected function attemptLogin(Request $request)
{
$check = $this->guard()->attempt(
$this->credentials($request), $request->has('remember')
);
if ($check === false)
{
$user = User::where('username','=',$request->input('username'))->first();
if(isset($user)) {
@akoepcke
akoepcke / RouteDirectives.php
Created January 23, 2020 16:16 — forked from calebporzio/RouteDirectives.php
Blade Route Directives
<?php
// Register these inside a service provider:
Blade::directive('route', function ($expression) {
return "<?php echo route({$expression}) ?>";
});
Blade::directive('routeIs', function ($expression) {
return "<?php if (request()->routeIs({$expression})) : ?>";
@akoepcke
akoepcke / twittermute.txt
Created January 24, 2020 19:19 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@akoepcke
akoepcke / gitmoji-cheatsheet.md
Created February 23, 2020 16:16 — forked from guillermocalvo/gitmoji-cheatsheet.md
Gitmoji Cheatsheet

Gitmoji Cheatsheet

Repository

  • 🎉 Initial commit
  • ⏪ Reverting changes
  • 🔀 Merging branches
  • 🙈 Adding or updating a .gitignore file
/* Apply a default duration to all .transition classes */
[class*="transition"] {
@apply duration-300;
}
/* Default transition class must come _before_ utilities,
so it can be overridden by any .duration-x utilities */
@tailwind utilities;
@akoepcke
akoepcke / opendb.sh
Created September 21, 2020 17:49 — forked from AlexVanderbist/opendb.sh
`opendb` command - opens the database for a Laravel app in your GUI
opendb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@akoepcke
akoepcke / gist:3f026b8588e67a755c5036c7c01bb981
Created October 16, 2020 16:30 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream