Skip to content

Instantly share code, notes, and snippets.

View marcusmoore's full-sized avatar

Marcus Moore marcusmoore

View GitHub Profile
@marcusmoore
marcusmoore / Middleware-CSP.php
Created May 2, 2024 19:29 — forked from valorin/Middleware-CSP.php
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@marcusmoore
marcusmoore / better-git-branch.sh
Created April 29, 2024 17:33 — forked from schacon/better-git-branch.sh
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@marcusmoore
marcusmoore / opendb-ddev.sh
Created September 24, 2020 02:55 — forked from AlexVanderbist/opendb-ddev.sh
opendb for ddev
opendb () {
unset GREP_OPTIONS
PORT="$(ddev describe | ggrep -Pio "(?<=port=)[0-9]*")"
open mysql://db:db@127.0.0.1:${PORT}/db
}
@marcusmoore
marcusmoore / README.md
Created July 14, 2020 19:12 — forked from MichaelCurrin/README.md
Github GraphQL - Get all file contents in repository

Get Github Files

Get the metadata and contents of all files in a target Github repo using GraphQL

Made for

Github V4 GraphQL API

About the query

## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
@marcusmoore
marcusmoore / current-dir-in-iterm-tab-title.sh
Created August 27, 2018 20:00 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@marcusmoore
marcusmoore / README-Template.md
Created January 8, 2018 23:30 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@marcusmoore
marcusmoore / AppServiceProvider.php
Created March 18, 2016 00:18 — forked from snipe/AppServiceProvider.php
Validate email array in Laravel 5.2 wth custom validator
<?php
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v3.0
*/
namespace App\Providers;
@marcusmoore
marcusmoore / GCalUtils.md
Created September 23, 2015 17:19 — forked from mogsdad/GCalUtils.md
Collection of Google Calendar related utility functions for Google Apps Script.

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

This is an additional paragraph for the excellent Contract Killer https://gist.github.com/malarkey/4031110
Hosting
We provide hosting for our own built websites on our preferred hosting provider <hosting provider name>.
Based on their SLA we endeavor to have 99.9% uptime on our servers measured annually.
There may of course be times when the server will not be available, this can be scheduled or unscheduled.
Scheduled downtime is when we know it is going to happen and tell you about it in advance. Scheduled downtime will wherever possible, almost certainly be outside of normal office hours. We’ll do our stuff in the evening or at weekend to minimize impact on your business.