Skip to content

Instantly share code, notes, and snippets.

View BrainFeeder's full-sized avatar

Robrecht Wellens BrainFeeder

View GitHub Profile
@BrainFeeder
BrainFeeder / CommaSeparatedList.php
Created January 4, 2017 11:57 — forked from gbrock/CommaSeparatedList.php
Joins an array of strings into a comma-separated string of readable output.
<?php
/**
* Joins an array of strings into a comma-separated string of readable output.
* Array ['John', 'Paul', 'George', 'Ringo'] becomes the string "John, Paul, George, and Ringo".
*
* @param array $items
* @param bool|true $oxfordComma
* @param string $conjunction
* @return string
@BrainFeeder
BrainFeeder / parties_import.sql
Created January 25, 2017 15:06 — forked from gbrock/parties_import.sql
MySQL setup of a simple Party Model-based address book.
#
# Basic Party Model implementation for MySQL.
# - Parties are either People or Organizations.
# - Party names are tracked separately, including first_used and last_used as dates.
# - Parties can have e-mails addresses, phone numbers, and physical addresses.
# - Parties can have Relationships with one another.
#
#
# Party Model: http://www.tdan.com/view-articles/5014/
# SO answer that helped me get started: http://stackoverflow.com/questions/5466163/same-data-from-different-entities-in-database-best-practice-phone-numbers-ex/5471265#5471265
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 20, 2015 at 01:42 PM
-- Server version: 5.5.40
-- PHP Version: 5.4.36-0+deb7u3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@BrainFeeder
BrainFeeder / index.php
Created December 21, 2017 12:18 — forked from facultymatt/index.php
Codeigniter subdomain routing index file. Support for admin dashboard.
<?php
date_default_timezone_set('America/New_York');
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your