This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Faker\Generator as Faker; | |
$factory->define(App\Category::class, function (Faker $faker) { | |
return [ | |
'user_id' => factory(\App\User::class), | |
]; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use App\Facades\FileLogger; | |
use Carbon\Carbon; | |
/** | |
* Makes easier the action of beginning/ending a file log. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\Illuminate\Support\Carbon::macro('age', function ($date) { | |
return $this->diff($this->parse($date))->format('%y'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
info="Services restarted: " | |
# Nginx | |
ps -ef | grep nginx | grep -v grep > /dev/null | |
if [ $? != 0 ] | |
then | |
sudo service nginx start > /dev/null | |
info="$info Nginx, " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias reload="source ~/.zshrc" | |
alias config="code ~/.zshrc" | |
# git | |
alias g="git" | |
alias gs="g status" | |
alias ga="g add" | |
alias gc="g commit -m" | |
alias gac="ga . && gc" | |
alias gb="g branch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$card = new \HpsCreditCard; | |
$card->number = '4111111111111111'; // visa testing card | |
$card->cvv = '123'; | |
$card->expMonth = '10'; | |
$card->expYear = '2010'; // expired! | |
$address = new \HpsAddress; | |
$address->address = '265 Peachtree Center Ave NE'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 with a tweak | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt-get update | |
sudo apt-get install python-certbot-nginx | |
# you should have your site's config file already created. /etc/nginx/sites-avalable/{domain.com} | |
# allow HTTPS through Firewall | |
sudo ufw allow 'Nginx Full' | |
sudo ufw delete allow 'Nginx HTTP' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/.valet/Sites | |
ln -s example api.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /path/to/project | |
valet link api.example |