Code Examples

Examples of some things for programming that I wanted to remember and share.

PHP CLI 5.3 on Godaddy Shared Hosting when SSHed in

Posted by Jason Hardin on June 9, 2014

I was trying to setup Silex on my GoDaddy shared hosting account today. I ran into a problem that the default configuration for an SSH user in GoDaddy’s shared hosting points to PHP 4 for CLI. After a little digging I found PHP5, but that was 5.2. Turns would there is a php 5.3 version on the server. The location is /usr/local/php5_3/bin/php. I ended up creating a .bashrc file and alias php=”/usr/local/php5_3/bin/php” to resolve the issues for me. Now I can install PHP composer without any issues.

Read More: PHP CLI 5.3 on Godaddy Shared Hosting when SSHed in

Game Time Scrapper

Posted by Jason Hardin on December 22, 2013

I track my time played in video games against what I paid for the game. Ultimately to figure out by cost per hour of game play. I have been using Raptr’s client for most of this year along with a Google apps spreadsheet to track my costs per hour. One of the issues I ran into however is that I have to manually add the play time from Raptr to the spreadsheet at the end of the week. This is a pain when I know that I can get this data grammatically. I create a game time scrapper program in Node js to convert the data on Raptr’s recent played games page to a JSON string that can then be processed by Google Apps with a custom script.

Read More: Game Time Scrapper

Gimp svg to png script

Posted by Jason Hardin on August 23, 2012

Been working on icons for Moodlerooms mockups using Balsamiq and was pointed to by a response to a comment I made. Rather than reading the actual documentation after downloading the icons I looked for a way to convert the svg file to png files. I then found, which now seems defunct. While for gimp 2.2 I figured out the changes I needed to make, mostly to the -b option to be –batch= and the –batch-interpreter=plug-in-script-fu-eval. I never did get the shell script to work but ended up just using the shell for command that I fixed. It looks like:

Read More: Gimp svg to png script