Skip to content

Instantly share code, notes, and snippets.

View ryansechrest's full-sized avatar
👨‍💻
Andiamo

Ryan Sechrest ryansechrest

👨‍💻
Andiamo
View GitHub Profile
@ryansechrest
ryansechrest / php-style-guide.md
Last active April 21, 2024 18:50
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@ryansechrest
ryansechrest / git.md
Last active April 12, 2024 09:17
Oh My Zsh Git Commands
Alias Command Description
ga <file> git add Add file to index
gaa git add --all Add all files to index
gb git branch See all branches
gcm git checkout master Checkout master branch
gcd git checkout develop Checkout develop branch
gco git checkout <branch> Checkout specified branch
gcb git checkout -b <branch> Create specified branch
gc git commit --verbose Commit and review changes
@ryansechrest
ryansechrest / html-style-guide.md
Last active March 14, 2024 20:44
HTML style guide with coding standards and best practices.

HTML Style Guide

All rules and guidelines in this document apply to HTML files.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Icon Legend:

· Space, Tab, Enter/Return

@ryansechrest
ryansechrest / a.md
Last active January 23, 2024 06:20
Tech Interview & Resume Tips
@ryansechrest
ryansechrest / ssh.md
Last active March 1, 2023 19:19
Create SSH Key

Create SSH Key

1a. Use ed25519 algorithm

ssh-keygen -t ed25519 -C "your_email@example.com"
  • -t Specifies the type of key to create.
  • -C Provides a new comment.
@ryansechrest
ryansechrest / a.md
Last active November 28, 2022 01:59
WordPress Plugin Skeleton

WordPress Plugin Skeleton

This plugin demonstrates how to:

  • Wrap plugin code in PHP class
  • Run code when plugin is activated, deactivated, and uninstalled
  • Register custom post type with labels, menu icon, Gutenberg, and featured thumbnail
  • Add custom admin columns and populate them with data
  • Add new meta box, render custom fields, and save custom field values in database
  • Register new settings, add new section to existing settings page, and sanitize values
@ryansechrest
ryansechrest / states.php
Last active November 15, 2022 20:23
PHP Arrays of U.S. States
# State Abbr => State Name; Vertical Format
[
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
@ryansechrest
ryansechrest / terminal.md
Last active October 6, 2022 03:47
Mac Terminal

Editor

Command Description
Control + A Jump to beginning of line
Control + E Jump to end of line
Control + U Delete text before cursor
Control + K Delete text after cursor
Control + W Delete word before cursor
Control + T Swap last two characters before cursor
@ryansechrest
ryansechrest / phpstorm.md
Last active October 6, 2022 03:45
PhpStorm Commands

Tool Windows

Command Description
+ 1 Project
+ 6 Problems
+ 7 Structure
+ 9 Git

Code

@ryansechrest
ryansechrest / .htaccess
Last active September 30, 2022 19:53
Sample configuration files for WordPress as Git submodule.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Prevent requests to index.php from being rewritten
RewriteRule ^index\.php$ - [L]
# Prefix specified PHP files with 'wordpress'
RewriteRule ^((wp-login|xmlrpc)\.php) wordpress/$1 [R=301,L]