Skip to content

Instantly share code, notes, and snippets.

View kelvinj's full-sized avatar

Kelvin Jones kelvinj

  • Bright Machine
  • Cheltenham, UK
View GitHub Profile
@kelvinj
kelvinj / lyrics.txt
Created December 25, 2018 21:48
Do They Know It's Christmas? 1984 vs 2014
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
@kelvinj
kelvinj / .bash_profile
Last active June 13, 2018 17:19
A little way of hacking bash to get some insight into your current shell environment
#
# 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:
@kelvinj
kelvinj / UpdatePasswordsOfGitReposUsingHttp.md
Last active August 29, 2015 14:03
Update passwords of git repos using an HTTP remote following a change of password on the server

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
@kelvinj
kelvinj / ProgramminAndI.md
Last active August 29, 2015 14:02
Programming & I

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.

#!/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
#!/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'
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which

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?

Awesome PHP Libraries

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