Skip to content

Instantly share code, notes, and snippets.

View abelevtsov's full-sized avatar
🏠
Working from home

Aleksandr Belevtsov abelevtsov

🏠
Working from home
  • SpeakerGuru OÜ
  • Tallinn, Estonia
View GitHub Profile
var system = require('system'),
env = system.env;
/**
* Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @param testFx javascript condition that evaluates to a boolean,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.
@abelevtsov
abelevtsov / CredentialManager.cs
Created October 25, 2016 10:44 — forked from meziantou/CredentialManager.cs
Using the Windows Credential API (CredRead, CredWrite, CredDelete, CredEnumerate)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
public static class CredentialManager
{
public static Credential ReadCredential(string applicationName)
@abelevtsov
abelevtsov / gist:477e383bd328252c1fe32e4b6101c927
Created July 15, 2017 11:44 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm
from collections import defaultdict
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
@abelevtsov
abelevtsov / IncrementBuildVersion.cs
Created April 15, 2018 20:02 — forked from yourpalmark/IncrementBuildVersion.cs
Unity: Post-process script that increments revision number of iPhone and Android builds. Uses CFBundleShortVersionString as well as CFBundleVersion. CFBundleShortVersionString (Version) is set to {Major}.{Minor}.{Build}. CFBundleVersion (Build) is set to {Revision}. Revision is the auto-incremented value on every build.
/**
* Copyright 2012 Calvin Rien
* (http://the.darktable.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*