Skip to content

Instantly share code, notes, and snippets.

Install PHP 8.1, node 16 and Docker in Ubuntu.

These scripts can be run with the following commands, by a super user. This installs a lot of stuff, read first.

You can add -s -- --dry-run to then end to do a dry run first.

These are tested on an ec2 instance running vscode remote

Usage

<?php
Builder::macro('deferredPaginate', function ($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) {
$model = $this->newModelInstance();
$key = $model->getKeyName();
$table = $model->getTable();
$paginator = $this->clone()
// We don't need them for this query, they'll remain
// on the query that actually gets the records.
@EmadAdly
EmadAdly / guide.md
Last active December 9, 2020 15:13
Deploying Laravel app in Amazon Ec2 or Lightsail

1- Creating the Lightsail or EC2 Instance

create a new Lightsail instance or EC2 instance From the AWS Management Console.

2- Connecting to the new instance

Once you create it, download the associated .pem file. you can be downloaded the default SSH key from your account page. we need to move it to the ~/.ssh directory. You can do so by executing

mv ~/Downloads/pemfile.pem ~/.ssh/pemfile.pem

Laravel Developer - Interview Exercise

  • Setup a fresh Laravel 5.8 application.
  • Use Tailwind CSS as the CSS framework.
    • CDN version is fine.
    • Bonus points if installed via NPM.
  • Create a new contact page at /contact.
  • Create a contact form on the page.
  • The form should be built as a Vue component.
  • The form should submit via ajax.
@chetans9
chetans9 / SecureHeadersMiddleware.php
Last active August 11, 2024 09:27
Laravel Secure Headers Middleware
<?php
namespace App\Http\Middleware;
use Closure;
class SecureHeadersMiddleware
{
// Enumerate headers which you do not want in your application's responses.
// Great starting point would be to go check out @Scott_Helme's:
// https://securityheaders.com/
@WebD00D
WebD00D / google-maps-geofence-complete-example.markdown
Created June 11, 2018 18:01
Google Maps Geofence Complete Example
@vzool
vzool / point-in-polygon.php
Created April 17, 2017 13:00
The point-in-polygon algorithm allows you to check if a point is inside a polygon or outside of it.
<?php
/*
Description: The point-in-polygon algorithm allows you to check if a point is
inside a polygon or outside of it.
Author: Michaël Niessen (2009)
Website: http://AssemblySys.com
If you find this script useful, you can show your
appreciation by getting Michaël a cup of coffee ;)
PayPal: [email protected]
@leonardofed
leonardofed / README.md
Last active July 10, 2025 04:43
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@peramsathyam
peramsathyam / stripe-button.css
Created May 5, 2016 00:57
Blue stripe connect button
/* Stripe Button */
.stripe-connect {
display: inline-block;
margin-bottom: 1px;
background-image: -webkit-linear-gradient(#28A0E5, #015E94);
background-image: -moz-linear-gradient(#28A0E5, #015E94);
background-image: -ms-linear-gradient(#28A0E5, #015E94);
background-image: linear-gradient(#28A0E5, #015E94);