Skip to content

Instantly share code, notes, and snippets.

@jpswade
jpswade / devops_best_practices.md
Last active May 3, 2024 11:49
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@jpswade
jpswade / 2022-09-06-engineering-blogs.md
Last active April 29, 2024 22:05
Engineering Blogs
title published description tags cover_image
Engineering Blogs
true
engineering, learning

I'm always interested in learning, especially around my roles in engineering and leadership.

@jpswade
jpswade / SqliteTrait.php
Created August 1, 2021 10:35
Laravel - no such function: CONCAT sqlite
<?php
namespace App\Traits;
use Illuminate\Database\SQLiteConnection;
use Illuminate\Support\Facades\DB;
trait SqliteTrait
{
protected static function setUpSqlite(): void
@jpswade
jpswade / laravel-best-practices.md
Created August 17, 2022 15:54
Laravel Best Practices

Laravel Best Practices

These are best practices, rather than coding standards.

Coding Standards should be guidelines that we should be aiming to stick to, relating to the way code is written and its readability.

Coding standards can be and should be defined by automation tools, such as phpCS and StyleCI.

Best Practices, however, are recommendations that may help with security, performance, or architectural patterns that are solutions to a commonly occurring problems.

@jpswade
jpswade / install_adb.sh
Last active December 26, 2023 10:39
Install android on centos
#!/bin/sh
# yum install android-tools -y
yum install java-1.8.0-openjdk-devel
mkdir -p android-sdk-linux
cd android-sdk-linux
# @see https://developer.android.com/studio/index.html
wget --output-document=android-sdk.zip --quiet https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip android-sdk.zip
rm -f android-sdk.zip
yes | tools/bin/sdkmanager --licenses
@jpswade
jpswade / Dockerfile-php56
Created July 31, 2018 20:28
PHP56 Build Dockerfile
FROM php:5.6-apache
MAINTAINER James Wade <jpswade@gmail.com>
# Install gd, iconv, mbstring, mcrypt, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apt-get update && apt-get install -y \
libbz2-dev \
libfreetype6-dev \
libgd-dev \
libjpeg62-turbo-dev \
@jpswade
jpswade / install_cpanel.sh
Last active October 5, 2023 15:54
Install cPanel for CentOS
#!/bin/bash
# setup_cpanel - Setup new cPanel Server.
# @see https://gist.github.com/jpswade/4e2826d5c88cee4eac72
# @see https://docs.cpanel.net/installation-guide/cpanel-dnsonly-installation/
set -e
### Settings
CPANEL_SCRIPT_URL=http://httpupdate.cpanel.net/
CPANEL_SCRIPT=latest
@jpswade
jpswade / php7.4-fpm-alpine
Last active September 9, 2023 20:43
PHP 7.4 PHP-FPM Alpine with core extensions gd
FROM php:7.4-fpm-alpine
# @see https://hub.docker.com/r/jpswade/php7.4-fpm-alpine
MAINTAINER Agent Software <dev@agentsoftware.net>
# Install gd, iconv, mbstring, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apk add --update \
$PHPIZE_DEPS \
freetype-dev \
git \
@jpswade
jpswade / install_opera.bat
Last active March 22, 2023 21:47
Install Opera
::install_opera.bat - Installs Opera Browser
@ECHO OFF
SETLOCAL EnableDelayedExpansion
::INSTALLPATH
SET INSTALLPATH=%ProgramFiles%
IF EXIST %ProgramFiles(x86)% SET INSTALLPATH=%ProgramFiles(x86)%
:SETTINGS
SET INSTALLEXE=Opera_1218_en_Setup_x64.exe
@jpswade
jpswade / scratch_1.php
Created November 20, 2022 10:07
How to get the full SQL query with bindings using Laravel Eloquent
<?php
/** How to get the full SQL query with bindings using Laravel Eloquent **/
dd(vsprintf(str_replace('?', '\'%s\'', str_replace('%', '%%', $query->toSql())), $query->getBindings()));