Archive for August, 2015

Under the Crypt: My first Mac OSX game !

Just this morning, we finally had our app “Under the crypt” accepted by Apple. It’s available for $0.99 cents and is available for Mountain Lion (64 Bit) or higher. It was designed with Xamarin – a .NET based cross platform app development system, – it is a port of a Phonegap app, that was previously available for Blackberry and Android on the Amazon app store. Thanks goes to to @veubeke, @UlrikeErdmann, and Tyber Zann for programming support!


Download here;

Categories: Uncategorized

Send email via #Amazon SES via PHP using #PHPMailer

$mail = new PHPMailer();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = “tls”;
$mail->Host = “”;
$mail->Port = 587;
$mail->Username = “xxxx”;
$mail->Password = “xxxx”;
$mail->CharSet = ‘windows-1250’;
$mail->SetFrom (‘’, ‘’);
$mail->Subject = “Subject line “;
$mail->ContentType = ‘text/plain’;
$mail->Body = “this is the body”;
$mail->AddAddress (‘’, ‘Someone’);
$error_message = “Mailer Error: ” . $mail->ErrorInfo;
} else
$error_message = “Successfully sent!”;
echo $error_message;

Categories: Uncategorized

Get details of a WebException in C=

If a HTTP call fails with a HTTP 500 error, and throws a WebException, you know something’s gone wrong, but sometimes the response from the server can explain more about what screwed up. I found myself writing this code over and over again, so here’s a single method that handles it;

private static string GetExceptionDetails(WebException exception)
string strResult = “”;
if (exception.Response != null)
var responseStream = exception.Response.GetResponseStream();
if (responseStream != null)
using (var reader = new StreamReader(responseStream))
strResult = reader.ReadToEnd();
return strResult;

Hope this helps solve your web related problems!

Categories: Uncategorized

Print an Image using #Xamarin.mac

Printing an image using Xamarin turned out to be much easier than I thought, I loaded the image from a URL into an NSImageCell using;

                string strUrl = “http;// Some Url with an image; // ?
                NSUrl url = new NSUrl (strUrl);
                this.imgCell.Image = new NSImage (url);

Then to print it, I used the command;

    partial void printButton (Foundation.NSObject sender) {
            NSPrintOperation p = NSPrintOperation.FromView(this.imgCell.ControlView);

Really surprised how easy that turned out to be!

Categories: Uncategorized

Email Proxy on #Azure #Webservice

Here’s a generic way to use a webservice to send email, and it’s been tested with Amazon SES. Proxying email like this saves exposing your own IP address to recipients, to avoid problems with your ISP, or main hosting provider.

Here’s the code;

using System.Net.Mail;
using System.Text;
using System.Threading;
using System.Web.Services;

/// <summary>
/// Summary description for EmailProxy
/// </summary>
[WebService(Namespace = “;)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class EmailProxy : WebService {

public void SendEmail(string smtpHost, string username, string password, int port, string to, string from, string subject, string body) {

var client = new SmtpClient
Port = port,
Host = smtpHost,
EnableSsl = true,
Timeout = 10000,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new System.Net.NetworkCredential(
var mm = new MailMessage(from, to, subject, body)
BodyEncoding = UTF8Encoding.UTF8,
IsBodyHtml = true,
DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure


Categories: Uncategorized

#Android #AppMarketing tip: Listing your app in China

Google play is virtually non-existent in china due to censorship rules, and Google’s exit from that market. Therefore to get downloads from china, you need to list your app on Chinese app stores. Most of which have an English version that you can navigate through. Here is a list of the top app stores in China – ordered by importance.

Myapp (Tencent)

Baidu Mobile Assistant

MIUI app store (Xiaomi)


Huawei App Store


Anzhi Market

Google Play


Categories: Uncategorized

Access Tripadvisor API in PHP


$url = “,-71.099396/attractions?key=xxxx&#8221;;

$json = HttpGet($url);

$djson = json_decode($json, true);
$htmlOut = “<ul>”;
foreach($djson[“data”] as $poi)
$htmlOut = $htmlOut . ‘<li><a href=”‘ . $poi[“web_url”] . ‘”>’ . $poi[“name”] . ‘</a> – ‘ . $poi[“address_obj”][“address_string”] . ‘</li>’;
$htmlOut = $htmlOut . ‘</ul>’;

echo $htmlOut;

function HttpGet($url) {
$ch = curl_init($url );
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT,’Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080311 Firefox/′);
curl_setopt($ch, CURLOPT_REFERER, ‘;);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
return $output;

Categories: Uncategorized
%d bloggers like this: