Skip to content

Instantly share code, notes, and snippets.

View IngmarBoddington's full-sized avatar

Ingmar Boddington IngmarBoddington

View GitHub Profile
@IngmarBoddington
IngmarBoddington / template-authors.php
Created August 2, 2012 14:50
Example authors page template for multi-author WordPress blogs
<?php
/*
Template Name: Authors
*/
?>
<?php get_header(); ?>
<!-- BEGIN #content-wrap -->
<div id="content-wrap" class="clearfix">
@IngmarBoddington
IngmarBoddington / template-archive.php
Created August 15, 2012 12:17
Generic Archive Page WordPress Template
<?php
/**
Template Name: Archive
*/
get_header(); ?>
@IngmarBoddington
IngmarBoddington / curl.inc.php
Created September 27, 2012 18:50
PHP cURL Wrapper
<?php
namespace glowingminds;
/**
* Simple wrapper for cURL page fetching
* @author Ingmar Boddington (https://github.com/IngmarBoddington | http://www.glowingminds.co.uk/)
* @author Barry Parkin (https://github.com/barryparkin | http://ba.rrypark.in)
* @version 1.1
*
* ~ Improved security of https connections to prevent man-in-the-middle atacks.
@IngmarBoddington
IngmarBoddington / class_sessionhandler.inc.php
Created October 25, 2012 13:48
PHP Database Session Handler
<?php
/**
* SessionHandler Class - Uses DB for session handling (for multiserver environment)
*
* @package glowingminds
* @author Ingmar Boddington
*/
class SessionHandler {
const TABLENAME = 'sessions';
@IngmarBoddington
IngmarBoddington / git
Last active September 15, 2022 13:54
Git Reference
git add . [-A]
- Recursively add all modified files to staging area
-A - Include removed files
git blame
- Show last modigified timestamp / author for each line of a file
git branch [-a] [-r] [-m] [-d] [-D] [<branch-name>]
- Lists local branches, give name to create branch
- Flags:git
@IngmarBoddington
IngmarBoddington / terminal
Last active August 23, 2020 16:04
General Linux / Bash Terminal Reference, commonly used commands and file locations. Key: <value> type of value will be hinted by string when relevant | [<optionalValue>] | <file(s)> means single filename or multiple space delimited filenames | <int>
Command History
===============
!! - Repeat previous command
!!:/s/<search>/<replace>/g - Repeat previous command with replaced string value
sudo !! - Repeat previous command with sudo
history - Show bash history
!<int> - Run a labelled command from history command
!<command> a - Re-run last use of command
<command>:p - Print rather than run (e.g. !!:p, to print last run command)
^<search>^<replace> - Run previous command replacing search with replace (for typos)
@IngmarBoddington
IngmarBoddington / mysql5
Last active November 18, 2019 18:05
Notes made initially whilst studying for the MySQL 5 Certified Associate Exam (and then expanded)
EXAM DETAILS
Main MySQL Website: http://www.mysql.com/
Certification Webpage: http://education.oracle.com/
Exam Name: MySQL 5 Certified Associate Exam
Exam Number: 1Z0-870
e
=========================================================================================================
EXAM TOPICS
Section 1: Theory, Terminology and Concepts (10%)
Client/Server Concepts
@IngmarBoddington
IngmarBoddington / gitflow
Created February 1, 2013 16:22
git flow commands (see: https://github.com/nvie/gitflow for resources)
git flow init
- Sets up 'proper' branch structure for repo
git flow feature
- List feature branches
git flow feature start <name>
- Begin a new feature branch from develop and switch to it
git flow feature finish <name>
@IngmarBoddington
IngmarBoddington / composer
Last active December 12, 2015 04:38
Composer PHP Dependency Manager notes - Full example json: http://composer.json.jolicode.com/
Composer Install
================
Download: curl -s https://getcomposer.org/installer | php
Install: mv composer.phar /usr/local/bin/composer
composer.json
=============
contains information of project dependencies
Example (Remember - no comments in json):
@IngmarBoddington
IngmarBoddington / phpTerminal
Last active December 12, 2015 09:39
Commands for using php and associated tools in terminal | Key: <value> type of value will be hinted by string when relevant | [<optionalValue>] | <file(s)> means single filename or multiple space delimited filenames | <int> means an integer | <int|range> means an integer or a range (two integers seperated by hyphen) | <string> means a quoted value
php
- Start interactive session
php -f <filename>
- Run specified script from cli
php -i
- Show PHP info
php -m