Skip to content

Instantly share code, notes, and snippets.

View jeffery's full-sized avatar
🏠
Working from home

Jeffery Fernandez jeffery

🏠
Working from home
  • Ping Identity
  • Melbourne, Australia
View GitHub Profile
@jeffery
jeffery / xvfb_daemon.sh
Created July 5, 2011 00:18 — forked from tommeier/xvfb_daemon.sh
Xvfb startup init script for headless selenium started via Jenkins
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Debian-compatible Xvfb startup script.
# Tom Meier <[email protected]>
# Jeffery Fernandez <[email protected]>
#
### BEGIN INIT INFO
# Provides: xvfb_daemon
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
@jeffery
jeffery / selenium
Created July 6, 2011 22:51 — forked from robinhoode/selenium
/etc/init.d/selenium
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
DESC="Selenium server"
RUN_AS=root
JAVA_BIN=/usr/bin/java
SELENIUM_DIR=/etc/selenium
PID_FILE="$SELENIUM_DIR/selenium.pid"
@jeffery
jeffery / Debianize-Git-Jenkins
Created July 19, 2011 23:18
Trigger the build of a debian package for a Git SCM project via Jenkins CI
#!/bin/bash
#
# This is a helper script to trigger the build of a debian package for a
# project which is in Git SCM and integrated via Jenkins CI
#
# The trigger used for the package build is a string "bump for release"
# which is part of the commit message for the Git repository.
#
# The Changelog is then parsed to obtain the release version and then
# the repository is exported for package building
@jeffery
jeffery / GeoLocator
Created July 20, 2011 22:42
MySQL Helper class for calculating Distances between to geo locations
<?php
class GeoLocator
{
/**
* @var string
*/
public static $tableGeoPostcodeSuburbState = 'geoAustralianLocations';
@jeffery
jeffery / GitRepoUpdateTimestamp.sh
Created July 30, 2011 13:04
Update Timestamp of files in Checked-out Git Repository
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
@jeffery
jeffery / dependencies.php
Created September 11, 2011 13:28
Script to visualize dependencies in a PHP project using PHP_Depend results
#!/usr/bin/env php
<?php
/**
* Usage:
* pdepend --jdepend-xml=/tmp/jdepend.xml /path/to/source
*
* ./dependencies.php /tmp/jdepend.xml -o /tmp/jdepend.svg
*/
class Dependencies
{
@jeffery
jeffery / inspekt.php
Created September 11, 2011 13:30
Script to inspect PHP_Depend results
#!/usr/bin/env php
<?php
/**
* Usage:
* pdepend --summary-xml=/tmp/summary.xml /path/to/source
*
* ./inspekt.php /tmp/summary.xml --metric0
*/
class Inspect
{
@jeffery
jeffery / traceAnalyser.php
Created March 21, 2012 23:40 — forked from Nycto/traceAnalyser.php
A helper script for analyzing the output of a PHP xdebug code trace
<?php
/**
* Analyzes the output of an XDebug script trace
*
* The original version can be found here:
* http://svn.xdebug.org/cgi-bin/viewvc.cgi/xdebug/trunk/contrib/tracefile-analyser.php?root=xdebug
*
* This version was created to work in PHP 5.2
*/
@jeffery
jeffery / installed-packages.sh
Created April 3, 2013 05:42
List installed Packages grouped by Repository for openSUSE
#!/bin/bash
for repo in `zypper repos --uri | tail -n+3 | awk -F ' ' '{ print $1 }'`
do
zypper se -sir "$repo"
echo
echo
done
@jeffery
jeffery / add_dom_javascript
Created July 18, 2013 10:22
add_dom_javascript
function add_dom_javascript(scriptFile, callBackFunction, callBackParams)
{
var fileAdded = false;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = scriptFile;
if ( (callBackFunction) && (arguments.length >= 2) )
{