Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/bash
suffix="`date +%Y%m%d%H%M%S`"
real="/var/www/html/myfirstproject_$suffix" # where the codebase really will be located
live="/var/www/html/myfirstproject-docker" # the live directory aka docroot for nginx
livetmp="/var/www/html/myfirstproject_tmp" # used temporarily for switching symlink target
db="/var/www/databases/myfirstproject/database.sqlite" # live sqlite database file
dbbackup="/var/www/databases/myfirstproject/database_$suffix.sqlite"
su -c "git clone git@github.com:WilECoyoteandAcme-Inc/myfirstproject-docker.git ~ubuntu/fresh" ubuntu
@kenguest
kenguest / PhpCSTask.php
Created June 15, 2021 14:52
Updated PhpCSTask file adding support for setting standard, report and outfile, keeping same parameter names as the phpcodesniffer equivalents.
<?php
/**
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@kenguest
kenguest / resume.json
Last active July 6, 2020 22:40
Resume in json format viewable at https://registry.jsonresume.org/kenguest
{
"basics": {
"name": "Ken Guest",
"label": "Software Developer",
"picture": "",
"email": "kguest@php.net",
"phone": "086 8252 141",
"website": "http://about.me/kenguest/",
"summary": "I've worked on developing leading HR solutions, e-banking software, distributed applications, network management tools and diagnostic tools, collaborating closely with my team members, project owners and managers. I'm an advocate of using the best suited tool or technology for the job - even to the extent of developing those required tools or enhancing existing Open Source tools to add the functionality required. For that reason, I have contributed significantly to phing - a PHP based build tool; to PEAR - the original repository of reusable PHP code packages. I have also contributed to best-practice oriented sites such as http://www.phptherightway.com/ and https://magentotherightway.com/.",
"profiles": [
@kenguest
kenguest / hg-changeset-url.sh
Created October 22, 2015 07:07
Determine changeset url for mercurial repo.
#!/bin/bash
# @Revision: 0.3
x=$(pwd);
rev=$1;
if [ ! -d "$x/.hg" ] ; then
while [ "$x" != "/" ] ;
do x=$(dirname "$x");
test -e "$x/.hg" && break;
done
fi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am kenguest on github.
  • I am kenguest (https://keybase.io/kenguest) on keybase.
  • I have a public key whose fingerprint is 4239 391C A197 0AA3 70AC 9ED5 8A07 4D4C 3F7E E1F2

To claim this, I am signing this object:

@kenguest
kenguest / hg-changemoddate
Created January 28, 2014 10:03
Script to change modification date of file in mercurial to last mod date according to mercurial. Useful for when you do a checkout and want a ls -lart to reflect when files were last changed.
#!/bin/bash
for i in $*
do
date=`hg log -l 1 $i --template '{date|isodate}\n'`
if [ "$date" != "" ] ; then
touch -m --date="$date" $i
else
echo "$i not in hg" > /dev/stderr
fi
done
@kenguest
kenguest / ArrayAsAsciiTable.php
Created July 31, 2013 17:28
Ordinarily, I would suggest use of PEAR's Console_Table package, this is just an example solution for the first test suggested at http://phpixie.com/blog/test-tasks-for-php-interviews-that-developers-will-enjoy-solving/
<?php
/**
* ArrayAsAcsiiTable.php
* 31-Jul-2013
*
* Ordinarily, I would suggest use of PEAR's Console_Table package, this
* is just an example solution for the first test suggested at
* http://phpixie.com/blog/test-tasks-for-php-interviews-that-developers-will-enjoy-solving/
*
* PHP Version 5
@kenguest
kenguest / PEARPackageVersionCheck.php
Last active September 29, 2015 21:28
Check if certain PEAR packages of a specific version are installed.
// Check if certain PEAR packages of a specific version are installed.
// Originally posted as a comment to http://xn--9bi.net/2007/10/13/pear-list/
<?php
require 'PEAR/Registry.php';
$reg = new PEAR_Registry;
define("NAME", 0);
define("VERSION", 1);
@kenguest
kenguest / gist:1036862
Created June 20, 2011 23:29
Synchronise twinkle's Do-Not-Disturb toggle with whichever status Skype has.
#!/usr/bin/php
<?php
/**
* twinklesync.php
* Synchronise twinkle's Do-Not-Disturb toggle with whichever status Skype has.
* 13-Apr-2011
*
* PHP Version 5
*
*/