Skip to content

Instantly share code, notes, and snippets.

@vmeln
vmeln / run-jasmine2.js
Created March 17, 2016 10:55
Jasmine-2.4.1 test runner for PhantomJS
"use strict";
var system = require('system');
/**
* 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.
@vmeln
vmeln / GoogleTranslator.cs
Created September 25, 2014 07:30
Requires Newtonsoft.Json package
public class GoogleTranslator
{
private readonly string _outLanguage;
private readonly string _inLanguage;
public GoogleTranslator()
{
_inLanguage = "en";
_outLanguage = "de";
}
@vmeln
vmeln / Params.Performance.cs
Created August 8, 2014 13:59
Performance of invoking method with params array parameter
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Console
{
class Program
@vmeln
vmeln / mongoinstall.bat
Created May 24, 2014 09:11
Installer of MongoDB service
cd "C:\Program Files\MongoDB 2.6 Standard"
md data\db
md log
echo "" > log\mongod.log
bin\mongod --logappend --logpath="C:\Program Files\MongoDB 2.6 Standard\log\mongod.log" --dbpath="C:\Program Files\MongoDB 2.6 Standard\data\db" --directoryperdb --install
net start MongoDB
pause
@echo off
set builderPath = reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath
FOR /F "tokens=2*" %%A IN ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath') DO SET filePath=%%B
"%filePath%\msbuild" "%1"
using System;
using System.Reflection;
namespace CompareProperties
{
class Program
{
static void Main(string[] args)
{
var object1 = new MyObject { Bool = false, Integer = 42, Long = 13 };
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace TestingConsoleProject
{
public class Entry
{
public const int STD_OUTPUT_HANDLE = -11;
@vmeln
vmeln / salesman.html
Last active January 1, 2016 06:19
Salesman problem solving with HTML5 and JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Salesman problem solution</title>
</head>
<body>
<canvas id="canvas" height="1920" width="1080" />
<script>
"use strict";
@vmeln
vmeln / QuickSort.cs
Created December 9, 2013 10:28
Quick Sort C#
using System;
namespace QuickSort
{
class Program
{
static void Main()
{
int[] arrayToSort = { 1, 340, 20, 40, 12, 15 };
Sort(arrayToSort, 0, arrayToSort.Length - 1);