Skip to content

Instantly share code, notes, and snippets.

😀
Loving Linux

J. Alexander Curtis jacurtis

😀
Loving Linux
Block or report user

Report or block jacurtis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jacurtis
jacurtis / forge.sh
Created Apr 27, 2019 — forked from radermacher/forge.sh
Laravel Forge Setup Script
View forge.sh
#
# 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 / ServerNamingSchemes.md
Last active May 3, 2019
The techniques I use to name cloud servers.
View ServerNamingSchemes.md
environment-purpose-Name-Geography

Environment

  • dev - Development
  • tst - Testing
  • stg - Staging
  • prd - Production
@jacurtis
jacurtis / no-right-click-on-images.js
Last active May 13, 2019
Removes right-click on images
View no-right-click-on-images.js
/*
* This script will look for all images on a page and prevent right clicking on an image.
*/
const images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++) {
images[i].addEventListener('contextmenu', event => event.preventDefault());
}
// Note: I threw this script together as requested by a subscriber. I personally don't recommend doing
@jacurtis
jacurtis / _media-queries.scss
Last active Jul 31, 2019
This will generate media query mixins with SCSS.
View _media-queries.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 / Directus-Nginx.conf
Created Jan 28, 2019
Configuration file for Nginx Directus Site.
View Directus-Nginx.conf
# 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 / phpcs.xml
Created Jan 26, 2019
The PHP Code Sniffer configuration file I use for Laravel Applications. I had to remove PSR2 code just because it causes lots of problems with magic function in route files and models and stuff. But otherwise a good basic code sniffer config to use in Laravel projects.
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<description>Laravel Coding Standards</description>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
@jacurtis
jacurtis / mysql-cli.sql
Created Jan 26, 2019
This is the command I use to create all of my new MySQL databases in the CLI. Insert your own database name. This sets up new databases using the utf8mb4 character set in the most popular method.
View mysql-cli.sql
CREATE DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@jacurtis
jacurtis / atom-styles.less
Created Dec 12, 2018
This is the stylesheet I use in Atom to get the design I like. It requires Fira Code (mono font) and FlottFlott (ligature font). But you can swap out your own fonts by replacing them in the sheet.
View atom-styles.less
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@jacurtis
jacurtis / Reserved-Subdomains.json
Last active Mar 3, 2019
This is a JSON (or compatible with most language arrays) array that contains a list of subdomains that you want to reserve in multi-tentant applications.
View Reserved-Subdomains.json
[
"a",
"aa",
"about",
"abuse",
"access",
"account",
"accounts",
"ad",
"admin",
@jacurtis
jacurtis / toast-notifications.blade.php
Last active Jul 1, 2019
Self Contained Vue.js Instance to Manage LaraFlash Notifications in Laravel
View toast-notifications.blade.php
{{--
This makes a great "partial" to add to your template layout file. It will self manage your
notifications so you do not need to worry about displaying them. Simply just add notifications
using LaraFlash (Laravel Package) in your controllers, and they will display intelligently
and elegantly into your views.
Simply use an @include statement in your main template/layout file to this partial so that
this partial is included with every view. The rest can be set once and forgotten.
Requirements:
You can’t perform that action at this time.