Skip to content

Instantly share code, notes, and snippets.

View igorkulman's full-sized avatar

Igor Kulman igorkulman

View GitHub Profile
using MockIAPLib;
using Store = MockIAPLib;
namespace YourAPP
{
/// <summary>
/// Service for mocking in-app purchases in debug mode
/// </summary>
public class MockWindowsPhoneStoreService: IWindowsPhoneStoreService
@igorkulman
igorkulman / requestQueue.js
Created February 20, 2014 10:16
Request queue for JavaScript
function requestQueue(url, startCallback, doneCallback) {
var requests = [];
function createRequest(parameters) {
var f = function() {
$.post(url, parameters)
.done(function() {
if (requests.length > 0) {
//console.log("processing next request");
var next = requests.pop();
@igorkulman
igorkulman / code.cs
Created January 22, 2014 22:22
Flurry Analytics usage in Windows Phone
private static string _flurryCode = "....";
@igorkulman
igorkulman / even.cs
Created January 22, 2014 22:18
Rx samples
List<int> numbers= Enumerable.Range(1,10);
List<int> evenNumbers= new List<int>();
foreach (int number in numbers)
{
if (number % 2 ==0)
{
evenNumbers.Add(number)
}
}
var hardwareId = packageSpecificToken.Id;
var signature = packageSpecificToken.Signature;
var certificate = packageSpecificToken.Certificate;
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyname));
}
}
string sIsoStorePath = @"\Shared\ShellContent\tile.png";
using (IsolatedStorageFile appStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
String sDirectory = System.IO.Path.GetDirectoryName(sIsoStorePath);
if (!appStorage.DirectoryExists(sDirectory))
{
appStorage.CreateDirectory(sDirectory);
}
using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(sIsoStorePath, System.IO.FileMode.Create, appStorage))
public TicketViewModel(Newtonsoft.Json.Linq.JToken ticket)
{ _city = (string)ticket.SelectToken("city");
_cityCes = (string)ticket.SelectToken("city_ces");
_currency = (string)ticket.SelectToken("currency");
....
}
<phone:PhoneApplicationPage.Resources>
<local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</phone:PhoneApplicationPage.Resources>
partial class AccountInTime
{
public Document ToDocument()
{
Document document = new Document();
document["_id"] = AccountId;
Type accountInTimeType = this.GetType();
PropertyInfo[] fieldInfo = accountInTimeType.GetProperties();
string[] bannedProperties = {"User", "Account"};
foreach (PropertyInfo info in fieldInfo)