Skip to content

Instantly share code, notes, and snippets.

# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@roni-estein
roni-estein / .aliases
Created October 17, 2021 08:53
Safe Nah Command Setup for MacOS
# NAHS
# Where I'm keeoing my nah related base functions.
# Main nah command
nah(){
git ls-files --exclude-standard -om | xargs -I {} bash -c 'safe-nah {}'
git clean -df
}
@roni-estein
roni-estein / refill-component.blade.php
Created April 23, 2020 02:02
Refill Component View
<div>
<div class="flex">
<div class="max-w-md w-1/2 p-8">
<h2 class="">You can now refill online!</h2>
<form wire:submit.prevent="openConfirmation">
<label class="block pt-6">
<div class="form-label">Name: @error('name')<br>{{ $message }}@enderror</div>
@roni-estein
roni-estein / RefillComponent.php
Created April 23, 2020 02:01
Livewire form, glitching on selects
<?php
namespace App\Http\Livewire;
use App\Events\RefillRequested;
use Livewire\Component;
class RefillComponent extends Component
{
public $name = '';
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
sudo brew services restart php71
echo "xdebug disabled"
@roni-estein
roni-estein / Controller.php
Created November 20, 2018 00:40
App\Http\Controller.php for click through behavior
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use phpDocumentor\Reflection\Types\Self_;
use Prophecy\Exception\Doubler\MethodNotFoundException;
<?php
namespace Tests;
/**
* Laravel + PHPUnit assert that blade files are being loaded.
*
* Trait AssertView
*/
trait Viewable
<?php
namespace Tests;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
// Use this area to add macros that are relevant to the database
// It will have access to testcase and domain test case. But
<?php
namespace Tests;
use App\Account;
use App\CompressionProfile;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Auth\SessionGuard;
// This sits on top of the regular test case and allows for macros
<?php
namespace App\Helpers;
use Illuminate\Database\Eloquent\Model as EloquentModel;
// This now makes a non abstract version of model so we can
// add macro's to model in certain situations like testing
class Model extends EloquentModel