Skip to content

Instantly share code, notes, and snippets.

View OGProgrammer's full-sized avatar
💭
PHP Dev Available For Hire!

Joshua Copeland OGProgrammer

💭
PHP Dev Available For Hire!
View GitHub Profile
@OGProgrammer
OGProgrammer / gist:2c572e3cb1c7f7fd486d2caea1186fc7
Last active October 30, 2023 02:35
PHP Optimization - Longhorn PHP 2023

Commands were tested with Debian - other systems may require diff flags/cmds

* indicate source for more info

Find free/used memory

free -mh

Find PHP FPM Memory Usage *

@OGProgrammer
OGProgrammer / gist:e0927933ace059f9a5b2c905622f2428
Created August 17, 2022 20:54
move left right one word - karabiner
{
"description": "Quick Move Forward and Backward by 1 word",
"manipulators": [
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"left_option"
@OGProgrammer
OGProgrammer / gist:e2a586d663fd9f50685bc2c8441c97bf
Created April 5, 2019 00:31
EasyEngine Create Site Bash Script
#!/usr/bin/env bash
#usage ./new-ee-site.sh <domain name≥ <subdomain> <short name>
# Short name is for when domain name is too long for mysql username.
echo "===Creating New EasyEngine WordPress Site==="
newSiteDomain="$1"
if [ -z "${newSiteDomain}" ]; then
echo "Site param missing! Script needs the domain name of the site. Ex: mysite.com"
exit
@OGProgrammer
OGProgrammer / Terraform+Jenkins+AWS+Docker-Instructions.md
Last active October 14, 2018 18:34
Terraform+Jenkins+AWS+Docker Tutorial Prep

Instructions

This tutorial will walk you through setting up a Jenkins Pipeline to Deploy a Docker app to AWS ECS using Terraform. If you are looking to use docker then this is the perfect choice for high traffic microservice infrastucture. The tutorial will show you the power of Terraform to provision your cloud infrastructure, how jenkins can help speed up deployments, and how AWS Elastic Container Service can be a great solution for hosting your Enterpise level applications. Be aware this tutorial will spin up infrastructure in AWS and you must run the destroy scripts at the end so you aren't leaving the example running.

Prerequisites

Please read the following and install/sign up for what you need before the tutorial for the best experience.

  • Use a *nix bash/zsh terminal (Mac/Linux)
FROM php:7.2-fpm-stretch
# needed PHAN and ast ext so I found this and copied some stuff https://github.com/mre/docker-php-phan
RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y unzip git curl
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# DEPS
@OGProgrammer
OGProgrammer / .gitignore_global
Last active November 3, 2017 22:54 — forked from octocat/.gitignore
Some common .gitignore configurations
# IDE Files #
###################
# IntelliJ
*.iml
*.iws
*.ipr
.idea/
# Eclipse
@OGProgrammer
OGProgrammer / talks.md
Created April 15, 2017 17:03
ZendCon Talk Submissions

Joshua Copeland

Tech Conference Talks

45-60 min presentations

Create your own dependancies!

Do you have multiple PHP projects with the same or similar logic? Are you sick of your team copy pasting code from one project to another? Let's talk about pulling all that shared code into one (or more) libraries and how to implement them in your projects via composer. We'll also be touching on related topics like statis, packagist, toran proxy, composer settings, code structure, autoloading, and strategies to use when refactoring classes into your new library. Quit duplicating code and come check out this talk!

@OGProgrammer
OGProgrammer / utag.318.js
Created February 21, 2017 15:08
350v2 bred hmac source
//tealium universal tag - utag.318 ut4.0.201701161351, Copyright 2017 Tealium.com Inc. All Rights Reserved.
try{(function(id,loader){var u={"id":id};utag.o[loader].sender[id]=u;if(utag.ut===undefined){utag.ut={};}
var match=/ut\d\.(\d*)\..*/.exec(utag.cfg.v);if(utag.ut.loader===undefined||!match||parseInt(match[1])<41){u.loader=function(o,a,b,c,l,m){utag.DB(o);a=document;if(o.type=="iframe"){m=a.getElementById(o.id);if(m&&m.tagName=="IFRAME"){b=m;}else{b=a.createElement("iframe");}o.attrs=o.attrs||{};utag.ut.merge(o.attrs,{"height":"1","width":"1","style":"display:none"},0);}else if(o.type=="img"){utag.DB("Attach img: "+o.src);b=new Image();}else{b=a.createElement("script");b.language="javascript";b.type="text/javascript";b.async=1;b.charset="utf-8";}if(o.id){b.id=o.id;}for(l in utag.loader.GV(o.attrs)){b.setAttribute(l,o.attrs[l]);}b.setAttribute("src",o.src);if(typeof o.cb=="function"){if(b.addEventListener){b.addEventListener("load",function(){o.cb();},false);}else{b.onreadystatechange=function(){if(this.r
<html>
<head>
<meta charset="UTF-8">
<?php
$debug=False;
set_time_limit(0);
$actionURL="/d3stryr-3stripes.php";
?>
<title>d3stryr 3stripes</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
All:
* Vagrant
* Virtual Box
* Composer
Setup a bashrc and bash_profile
MacOS:
* brew
* php70 keg from brew
Windows: