Skip to content

Instantly share code, notes, and snippets.

View superern's full-sized avatar
💭
I may be slow to respond.

superern superern

💭
I may be slow to respond.
View GitHub Profile
@BenSampo
BenSampo / deploy.sh
Last active July 16, 2024 07:53
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@edilsoncichon
edilsoncichon / AWS_Single_LetsEncrypt.yaml
Last active March 19, 2021 17:29 — forked from tony-gutierrez/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and Apache.
# Dont forget to set the env variable "CERT_DOMAIN", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
# @source https://gist.github.com/tony-gutierrez/198988c34e020af0192bab543d35a62a#file-aws_single_letsencrypt-yaml-L2
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
@simonhamp
simonhamp / AppServiceProvider.php
Last active June 12, 2024 11:05
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@tylermakin
tylermakin / ec2-ftp-tutorial.md
Last active March 30, 2024 05:13
Tutorial for configuring FTP access to an EC2 server
@ibrahimlawal
ibrahimlawal / PaystackFees.php
Last active April 6, 2020 00:57
A php class to add paystack's local charge to a transaction total. Totally flops if the user pays with a foreign card.
<?php
class PaystackFees
{
const DEFAULT_PERCENTAGE = 0.015;
const DEFAULT_ADDITIONAL_CHARGE = 10000;
const DEFAULT_THRESHOLD = 250000;
const DEFAULT_CAP = 200000;
public static $default_percentage = PaystackFees::DEFAULT_PERCENTAGE;
@tony-gutierrez
tony-gutierrez / AWS_Single_LetsEncrypt.yaml
Last active March 7, 2024 11:29
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443