Category: Website Programming

Writing an Offline Web browser for iOS

By , June 8, 2014 9:31 am

I’m work on a project for work. They need the capability to have an offline web browser to view an HTML5 document. I found a couple of good resources for using Hype and Xcode.

http://macsfuture.com/post/59921246236/embedding-a-hype-2-0-html5-project-into-an-ios-app

http://system-log.tyr.org.uk/2012/02/08/using-tumult-hype-for-ios-game-titles/ 

I’m not using PhoneGap, but if you are looking for some info check out this post

http://hype.desk.com/customer/portal/articles/608835-tumult-hype-within-ios-an-xcode-phonegap-tipsheet

Enable Virtual host on XAMPP for OSX

By , April 26, 2014 10:42 pm

I just upgraded XAMPP to the latests version and in doing so I was no longer able to access my files stored in my Users/user/Sites folder. By default XAMPP does’t come setup for allowing virtual hosting. You have to setup it up yourself. This is the process to setup Virtual Hosting on OSX 10.8.3.

  1. Open Terminal. It is located in your Applications/Utilities folder
  2. Type in the following command.

    sudo pico /Applications/XAMPP/xamppfiles/etc/httpd.conf

  3. Press Control key and V to scroll down to the bottom of the file. Keep doing it until you find the following lines.

    # User home directories
    #Include etc/extra/httpd-userdir.conf

  4. Uncomment out Include ext/extra/httpd-userdir.conf by deleting the # sign. It should look like this when you are done.

    # User home directories
    Include etc/extra/httpd-userdir.conf

  5. Save the changes. Press the Control Key and O. The click the Control Key and T.
  6. Select the httpd.conf file name and hit the Enter Key. This will over write the httpd.conf with the changes you just made.
  7. Press the Control Key and X to exit the editor.
  8. Next type in the following command in to Terminal to edit the httpd-userdir.conf file.

    sudo pico /Applications/XAMPP/xamppfiles/etc/extra/httpd-userdir.conf

  9. Find the follow line and comment it out.

    UserDir public_html

  10. It should look like this after you comment it out: #UserDir public_html
  11. Type in the following line: UserDir Sites
  12. Find the following lines and comment them out.

    <Directory “/home/*/public_html”>

  13. Add the following line: <Directory “/Users/*/Sites/”> right after the line you just commented out.
  14. Save the changes. Press the Control Key and O. The click the Control Key and T.
  15. Select the httpd-userdir.conf file name and hit the Enter Key. This will over write the https.conf with the changes you just made.
  16. Press the Control Key and X to exit the editor.
  17. Restart the Apache Server.

Random Linkshare ads PHP Script

By , November 1, 2009 9:48 am

I’ve been using LinkShare for years and one thing I hate about them is their random ads generator. It doesn’t work to well. Sometimes you get blank ads, and sometimes the ads are distorted and sometimes you get an ad that should be displayed. So I came up with this little PHP script. There is no limit on how many ads you can put in the script.

<?

//set the urls

$urls = array(
“http://click.linksynergy.com/fs-bin/click?id=Oj2S/gUYGEM&offerid=13850.10000348&type=4&subid=0”,
“http://click.linksynergy.com/fs-bin/click?id=Oj2S/gUYGEM&offerid=13850.10000335&type=4&subid=0”,
“http://click.linksynergy.com/fs-bin/click?id=Oj2S/gUYGEM&offerid=146261.10005058&type=4&subid=0”
);

//set the img links

$img = array(
“http://www.gamestop.com/gs/aflbanners/125x125_eb_re5.jpg”,
“http://www.gamestop.com/gs/aflbanners/468x60_gs_dsi.jpg”,
“http://images.apple.com/itunesaffiliates/US/2009/10/01/Smallville_s9_300x300.jpg”
);

//set the alt text s
$alttext = array(
“GameStop.com – Resident Evil 5”,
“GameStop.com – Nintendo DSi”,
“Apple iTunes – Smallville”
);

//set the linkshare images
$lnkimg = array(
“http://ad.linksynergy.com/fs-bin/show?id=Oj2S/gUYGEM&bids=13850.10000348&type=4&subid=0”,
“http://ad.linksynergy.com/fs-bin/show?id=Oj2S/gUYGEM&bids=13850.10000335&type=4&subid=0”,
“http://ad.linksynergy.com/fs-bin/show?id=Oj2S/gUYGEM&bids=146261.10005058&type=4&subid=0”
);

srand(time());

//set the number in (rand()%3); for however many links there are

$random = (rand()%3);

echo (“<a href = “$urls[$random]”>
<img alt=”$alttext[$random]” src=”$img[$random]”></a>
<img border=”0″ width=”1″ height=”1″ src=”$lnkimg[$random]”>”);

?>

Panorama Theme by Themocracy