Instantly share code, notes, and snippets.

View lyrics.txt
It's Christmas time, there's no need to be afraid
At Christmas time, we let in light and we banish shade
And in our world of plenty we can spread a smile of joy
Throw your arms around the world at Christmas time
But say a prayer, pray for the other ones
At Christmas time it's hard, but while you're having fun
There's a world outside your window and it's a world of dread and fear
Where a kiss of love can kill you
Where there's death in every tear
And the Christmas bells that ring there are the clanging chimes of doom
View .bash_profile
#
# Author: Kelvin Jones
# Github: https://github.com/kelvinj
# Inspired by http://marcpalmer.net/hacking-my-shell-prompt-so-i-make-less-mistakes-working-with-xcode-projects/
#
# This is a .bash_profile file that you can write to your home directory to give
# you a custom shell prompt with various bits of info about your environment.
#
# Available options:
View UpdatePasswordsOfGitReposUsingHttp.md

The passwords will be stored in .git/config, so what we need to do is:

  1. find all files in the current directory that match '*/.git/config',
  2. swap out the old password for the new…
  3. making a backup of the original,
  4. and the display the names of the files that have been changed for double-checking
View ProgramminAndI.md

Programming & I

It was 1999 & I was living in Paris & working as helpdesk support for Anheuser-Busch… proper hardware IT-like helpdesk. I was an imposter… didn't know what I was doing, but I was loving it.

My free local dial-up company, free.fr, had some obscure news item next to their webmail login that said their free hosting now included support for PHP3 & MySQL.

I didn't know what the hell these things were, but I was intrigued. I skipped over to the Eyrolles book store in Saint Michel & bought a couple of books.

Well, the one on PHP was the first edition of Core PHP Programming by Leon Atkinson. I read it from cover to cover like a novel.

View start_stop_memcached_script.sh
#!/bin/bash
#
BASE=/tmp
PID=$BASE/app.pid
LOG=$BASE/app.log
ERROR=$BASE/app-error.log
PORT=11211
LISTEN_IP='0.0.0.0'
MEM_SIZE=4
View install.sh
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
View global.php
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
View challenge.md

Challenge: you need a flexible (swap in other repository implementations) way to display some kind of resource. Let's say, Posts. What does your folder structure look like?

Requirements:

  • Repository implements an interface
  • Must show at least one implementation of the interface (Eloquent version is fine)
  • The interface is injected into your PostsController.
  • Show where you register your IoC bindings
  • Show folder structure. Where are interfaces/repositories stored?
View awesome-php.md

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).