Skip to content

Instantly share code, notes, and snippets.

View igorkulman's full-sized avatar

Igor Kulman igorkulman

View GitHub Profile
public static GeoCoordinate AddMetersToGeoCoordinate(GeoCoordinate current, double metersH, double metersV)
{
return new GeoCoordinate(current.Latitude + (metersH / (111111)), current.Longitude + (metersV / (111111 * Math.Cos(current.Latitude))));
}
var filter = new HttpBaseProtocolFilter();
#if DEBUG
// *******************
// IGNORING CERTIFACTE PROBLEMS
// *******************
filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.IncompleteChain);
filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.Expired);
filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);
// *******************
@igorkulman
igorkulman / chocolatey.cmd
Last active May 4, 2018 02:16
Chocolatey script to install all the dev software
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
@igorkulman
igorkulman / AssociationUriMapper.cs
Last active August 29, 2015 14:00
AssociationUriMapper settings for being a share contract target in Windows Phone 8.1 Silverlight app
public class AssociationUriMapper : UriMapperBase
{
public override Uri MapUri([NotNull] Uri uri)
{
var op = (Application.Current as App).ShareOperation;
if (op != null)
{
var link = op.Data.GetWebLinkAsync().GetResults();
return new Uri("/Views/AddedView.xaml?Uri=" + HttpUtility.UrlEncode(link.ToString()), UriKind.Relative);
@igorkulman
igorkulman / AppStore.fs
Last active August 29, 2015 13:58
Mobile app stores crawler in F#
type AppStoreData = JsonProvider<"http://itunes.apple.com/search?term=LEMA&entity=software&country=CZ">
let searchAppStore (term:string) (country:string) =
let data = http (sprintf "http://itunes.apple.com/search?term=%s&entity=software&country=%s" term country)
let res = AppStoreData.Parse data
res.Results
|> Seq.map (fun x-> {Name=x.TrackName; Package=x.BundleId; IconUrl=x.ArtworkUrl60; StoreUrl = ""})
@igorkulman
igorkulman / build.bat
Created March 28, 2014 20:25
Windows Phone build script made with F# FAKE
@echo off
cls
"tools\nuget\nuget.exe" "install" "FAKE" "-OutputDirectory" "tools" "-ExcludeVersion"
"tools\FAKE\tools\Fake.exe" build.fsx
pause
@igorkulman
igorkulman / AddressBookService.cs
Last active August 29, 2015 13:57
Getting Address Book info in async/await way
/// <summary>
/// Address book wrapper
/// Needs address book permissions to work
/// </summary>
public class AddressBookService : IAddressBookService
{
/// <summary>
/// Gets a list of contacts in device address book
/// </summary>
/// <returns>List of contact</returns>
@igorkulman
igorkulman / line.caliburn.cs
Created March 15, 2014 19:15
Windows Phone: a way to get rid of the 1px line under Systray in 720p
protected override PhoneApplicationFrame CreatePhoneApplicationFrame()
{
var frame = new PhoneApplicationFrame { Margin = new Thickness(0, -1, 0, 0) };
return frame;
}
private void SetupMockIAP()
{
MockIAP.Init();
MockIAP.RunInMockMode(true);
MockIAP.SetListingInformation(1, "en-us", "A description", "1", "TestApp");
// Add some more items manually.
ProductListing p = new ProductListing
{
using MockIAPLib;
using Store = MockIAPLib;
namespace YourAPP
{
/// <summary>
/// Service for mocking in-app purchases in debug mode
/// </summary>
public class MockWindowsPhoneStoreService: IWindowsPhoneStoreService