Skip to content

Instantly share code, notes, and snippets.

View shaneparsons's full-sized avatar

Shane Parsons shaneparsons

View GitHub Profile
@shaneparsons
shaneparsons / .bash-aliases
Last active June 17, 2022 13:54
Misc aliases for docker / docker-compose
alias d="docker"
alias dc="docker-compose"
alias dcb="docker-compose build"
alias dcd="docker-compose down --remove-orphans"
alias dce="docker-compose exec"
alias dcei="docker-compose exec -it"
alias dcr="docker-compose run"
alias dcrr="docker-compose run --rm"
alias dcrmv="docker-compose rm -f -v"
alias dcrs="docker-compose restart"
@shaneparsons
shaneparsons / git-production.md
Last active July 10, 2020 14:46
Git / push to production workflow

Git / push to production workflow

From the remote server

Create the repo

mkdir /git && cd /git
git init --bare --shared [app].git

Create the post-receive hook file

@shaneparsons
shaneparsons / .prettierrc
Created July 4, 2019 16:19
Prettier config
{
"printWidth": 9999,
"singleQuote": true,
"tabWidth": 2,
"overrides": [
{
"files": ["*.php", "*.scss"],
"options": {
"tabWidth": 4
}
@shaneparsons
shaneparsons / laravel-auth-unique-username.md
Last active November 15, 2022 18:42
Laravel - Auth / Unique username instead of email

Laravel - Auth / Unique username instead of email

ForgotPasswordController.php

/**
 * Send a reset link to the given user.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
 */
public function sendResetLinkEmail(Request $request)
@shaneparsons
shaneparsons / bootstrap-util.md
Last active April 9, 2018 18:26
Bootstrap 4 additions / utilities / overrides

Responsive sizing

$sizes: (
  auto: auto,
  25: 25%,
  50: 50%,
  75: 75%,
  100: 100%,
);
@shaneparsons
shaneparsons / ionic-publish.md
Last active February 16, 2024 10:13
Preparing for Release / Publishing an Ionic App

Preparing for Release / Publishing an Ionic App

Customizing Cordova's config.xml file

Go to your project root and open config.xml file in your text editor.

The first thing to change is your app's human readable name. Replace the name inside <name> </name>.

Second, change the id value inside

@shaneparsons
shaneparsons / laravel-snippets.md
Last active March 27, 2019 18:23
Various snippets for Laravel

Show duplicate rows

$dupes = $items->diff($items->unique('name'));
return $dupes;

Limit results

$items = Item::limit(60)->get();

Passport

@shaneparsons
shaneparsons / gist:a9903ad7a0a34ced56027d984323f108
Created April 21, 2017 21:30
The PHP Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.
[Info - 5:22:37 PM] 3620 files total
[Info - 5:22:37 PM] Indexing project for definitions and static references
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Console/Kernel.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Events/Event.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Events/ExampleEvent.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Exceptions/Handler.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Http/Controllers/Controller.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Http/Controllers/ExampleController.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Http/Controllers/MarkersController.php
Parsing file:///Users/30ptdesign/Code/trail-guide/api/app/Http/Controllers/MessagesController.php
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@shaneparsons
shaneparsons / Helpers.php
Last active August 23, 2021 04:06
Lumen - helpers compatibility
<?php
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Debug\Dumper;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
if (! function_exists('append_config')) {