Skip to content

Instantly share code, notes, and snippets.

View bdolor's full-sized avatar

Brad Payne bdolor

View GitHub Profile
@bdolor
bdolor / gist:afff9e8091cbe94acddaf61852ab3e6c
Last active April 21, 2016 16:16
creative commons api implementation
/**
* Hits the creative commons api, gets an xml response.
*
* @param string $string
* @param string $authors
* @return string $html license blob
*/
private function licensePicker($string, $authors)
{
$v3 = false;
@bdolor
bdolor / rhel-server-config
Created March 31, 2014 19:30
New RHEL 6.x server config
# Type the following commands to see current version:
cat /etc/redhat-release
# To list all packages with updates available with new release, enter:
yum clean all
yum check-update
# Verify open ports and make sure your apps are running without any problems with the following commands:
netstat -tulpn
tail -f /var/log/messages
protected function csvToAssocArray( $file ) {
if ( ! file_exists( $file ) || ! is_readable( $file ) ) return FALSE;
$header = NULL;
$data = array ( );
if ( ($handle = fopen( $file, 'r' )) !== FALSE ) {
while ( ($row = fgetcsv( $handle, 10000 )) !== FALSE ) {
if ( ! $header ) $header = $row;
else $data[] = array_combine( $header, $row );
}