Skip to content

Instantly share code, notes, and snippets.

View thehelvetian's full-sized avatar

The Helvetian thehelvetian

View GitHub Profile
<?php
return [
'client_id' => env('PAYPAL_CLIENT_ID', ''),
'secret' => env('PAYPAL_SECRET', ''),
'settings' => array(
'mode' => env('PAYPAL_MODE', 'sandbox'),
'http.ConnectionTimeOut' => 30,
'log.LogEnabled' => true,
'log.FileName' => storage_path() . '/logs/paypal.log',
<?php
namespace App\Http\Controllers;
use Gloudemans\Shoppingcart\Facades\Cart;
use Illuminate\Support\Facades\Input;
use PayPal\Api\Amount;
use PayPal\Api\Item;
use PayPal\Api\WebProfile;
use PayPal\Api\ItemList;
@thehelvetian
thehelvetian / GitCommitEmoji.md
Created June 20, 2019 02:32 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@thehelvetian
thehelvetian / UsersController.php
Created June 14, 2019 01:17 — forked from luckys383/UsersController.php
Laravel: Common Filters using Model Scope
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Http\Request;
class UsersController extends Controller
{
protected $model;
<?php
namespace App;
use App\Models\AppModel;
use App\Traits\FilterTrait;
class User extends AppModel
{
use FilterTrait;
<?php
namespace App\Traits;
trait FilterTrait {
/**
* add filtering.
*
* @param $builder: query builder.
@thehelvetian
thehelvetian / us-state-names-abbrevs.php
Created March 30, 2019 15:21 — forked from maxrice/us-state-names-abbrevs.php
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@thehelvetian
thehelvetian / codepipeline.yml
Created January 1, 2019 06:57 — forked from li0nel/codepipeline.yml
CodePipeline
---
AWSTemplateFormatVersion: 2010-09-09
Parameters:
RepositoryBranch:
Type: String
Default: master
Cluster:
# Create your CloudFormation stack from scratch using the create-stack command
aws cloudformation create-stack
--stack-name=laravel
--template-body=file://master.yaml
--capabilities CAPABILITY_NAMED_IAM
--parameters
ParameterKey=CloudFrontOAI,ParameterValue=origin-access-identity/cloudfront/YOUR_CF_OAI_HERE
ParameterKey=CertificateArnCF,ParameterValue=arn:aws:acm:us-east-1:your_cloudfront_certificate_arn_here
ParameterKey=CertificateArn,ParameterValue=arn:aws:acm:us-east-1:your_certificate_arn_here
ParameterKey=BaseUrl,ParameterValue=laravelaws.com
AlarmTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
- Endpoint: [email protected]
Protocol: email
CPUAlarmHigh:
Type: AWS::CloudWatch::Alarm
Properties: