Skip to content

Instantly share code, notes, and snippets.

View jacurtis's full-sized avatar

J. Alexander Curtis jacurtis

View GitHub Profile
@jacurtis
jacurtis / USA-select-state-list.html
Last active April 18, 2024 13:33
A full list of USA states for using in an HTML state dropdown
<select>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 15, 2024 12:05
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@jacurtis
jacurtis / App\Exceptions\Handler.php
Created July 28, 2016 02:31
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
@jacurtis
jacurtis / regex.md
Last active April 5, 2023 14:42
Most Useful Regex's

Useful Regular Expressions

These are the most useful Regular Expressions that I find myself using on a regular basis


URLs

Test to see if a string is a valid website address or not.

All URLs
@jacurtis
jacurtis / _media-queries.scss
Last active January 30, 2023 15:08
This will generate media query mixins with SCSS.
$mobile: 768px !default;
$tablet: 769px !default;
$desktop: 1024px !default;
$widescreen: 1216px !default;
$fullhd: 1408px !default;
// Mobile Devices Only
// (0 - 768px)
@mixin mobile {
@media only screen and (max-width: $mobile) {
@jacurtis
jacurtis / forge.sh
Created April 27, 2019 05:29
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
@jacurtis
jacurtis / Directus-Nginx.conf
Created January 28, 2019 21:58
Configuration file for Nginx Directus Site.
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/cms.jacurtis.com/before/*;
server {
root /home/forge/cms.jacurtis.com/public;
index index.php index.html index.htm;
server_name cms.jacurtis.com;
# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
@jacurtis
jacurtis / gist:fb19e36177c5cc575d9b006385ae64d1
Created August 26, 2022 00:29 — forked from AlexanderRD/gist:485f12395cc30f3444b7
Delete all git branches with prefix
git branch -D `git branch | grep 'ard_*'`
@jacurtis
jacurtis / aws_json.py
Last active December 1, 2021 12:42 — forked from jeffbrl/describe_instances.py
How to make boto3 responses with datetime.datetime json serializable - boto3 ec2 describe_instances or rds describe_db_instances
# The file that does the voodoo magic
# Inspired by:
# - https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable
# - https://gist.github.com/jeffbrl/67eed588f2d32afcaf3bf779bd91f7a7
import json
import datetime
def pretty_print(data):
print(json.dumps(data, default=__datetime_handler, indent=4))
@jacurtis
jacurtis / 1) Main.blade.php
Created February 16, 2017 16:37
Laravel 5.4 Components & Slots
<!-- This is the main Blade file that you want your components to show up in -->
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>