Skip to content

Instantly share code, notes, and snippets.

View svrooij's full-sized avatar

Stephan van Rooij svrooij

View GitHub Profile
@svrooij
svrooij / resolve.cs
Last active August 29, 2015 14:18
Resolve exchange alias to SMTP-address
var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Url = new Uri("https://serv/EWS/exchange.asmx");
service.Credentials = new NetworkCredential("001234", "PasswordForUser001234", "Domain");
//Never use this part in production!!
//ServicePointManager.ServerCertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) =>
// {
// return true;
// };
@svrooij
svrooij / TintImageStringElement.cs
Last active August 29, 2015 14:02
Use tinted images in MonoTouchDialog ImageStringElement
using System;
using MonoTouch.UIKit;
namespace MonoTouch.Dialog
{
public class TintImageStringElement : ImageStringElement
{
public UIColor TintColor { get; set; }
public TintImageStringElement (string caption, UIImage image):base(caption,image.ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate))
{
TintColor = UIColor.FromRGB (102, 51, 102);
@svrooij
svrooij / security_failure.cs
Last active January 2, 2016 07:19
Security failure for mobile apps!This is a sample found on the internet, and this is way their are a lot of mobile apps that are broken. You can easily make it talk to an other server....
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => {
Console.WriteLine("Certificaat: {0}",certificate.Subject);
Console.WriteLine("SslPolicy: {0}",sslPolicyErrors);
return true; //This row is the problem. If you don't know why, I wouldn't use apps from your company!
};
@svrooij
svrooij / options.js
Last active December 25, 2015 12:09
Ninja Blocks Presence Widget
return {
"name": "Ping Presence",
"deviceMap": [
{deviceId:264},
{deviceId:261}
]
}