Skip to content

Instantly share code, notes, and snippets.

View Restuta's full-sized avatar
🦄
Hacking fast and slow.

Anton Vynogradenko Restuta

🦄
Hacking fast and slow.
View GitHub Profile
@Restuta
Restuta / StringExtensions.cs
Created August 26, 2010 20:25
Various useful System.String extensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AutoAssemblyVersion
{
/// <summary>
/// Contains string extensions.
/// </summary>
@Restuta
Restuta / CsvFieldsSaver.cs
Created September 22, 2010 22:54
CsvFieldsSaver + Tests
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Restuta;
using System.Text;
namespace Restuta.FieldSavers
{
/// <summary>
while not inFSO.FileExists(pdfFileName1) and not inFSO.FileExists(pdfFileName2)
ExecuteSQL("waitfor DELAY '00:00:02'")
Enumerable.Range(0, 1000000)
.AsPrallel()
.Agregate((x, y) => x + y);
@Restuta
Restuta / gist:812753
Created February 5, 2011 20:16
Tanahas first programm =)
<html>
<head>
<Script Language="JavaScript">
//мой скрипт
Lets = new Date();
var mya = Lets.getMonth();
var mya1 = mya + 1
document.write("<font color='green'>Привет. Сегодня " + Lets.getDate() + "/" + mya1 + "/" + Lets.getFullYear() + ". Я написала этот скрипт, потому, что ... так оно и есть!</font>");
@Restuta
Restuta / gist:1772878
Created February 8, 2012 20:03
find a thread safety bug
using System;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class ThreadUnsafe
{
public static int _val1 = 1;
public static int _val2 = 1;
@Restuta
Restuta / PlanB.md
Created February 15, 2012 17:48 — forked from chaliy/PlanB.md
31337 Book

Not in particular order

  1. Perfectionism
  2. Revision Control
  3. Continuous XXX
  4. Async your life
  5. Persistence
  6. Testing
  7. Communitcation
  8. GTD (o_O)
@Restuta
Restuta / mspec-equality-tests.cs
Created March 1, 2012 01:32 — forked from kolesnick/mspec-equality-tests.cs
ReSharper template for MSpec tests of Equals method and == operator
/*
Please remove this comment only after placing this template to ReSharper template editor.
Existance of this comment during paste will automatically align macroses in shown order.
Macroses:
$Entity$ - EntityName
$entity$ - entityName
$entity_in_when_part$ - entity_name
$entities_in_when_part$ - entity_name_in_plural
$usage_of_initial_parameters_in_ctor$ - arguments of factory method supplied to constructor
@Restuta
Restuta / gist:1947397
Created March 1, 2012 04:57
Measure.Performance (Simplifies work with Stopwatch class)
using System;
using System.Collections.Generic;
namespace PerformanceMeasurementMadeEasy
{
public static class Measure
{
private static readonly System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
/// <summary>
/// Will be executed at the end of each peformance measurment, by default writes elapsed ms to Console
@Restuta
Restuta / C#.sublime-build
Created March 19, 2012 06:39 — forked from chaliy/C#.sublime-build
Sublime Build to compile and run C# program
{
// This build system will build your cs file to exe file and will run it
"cmd": ["del ${file/\\.cs/\\.exe/} 2>NUL", "& csc /nologo /out:${file/\\.cs/\\.exe/} $file", "& ${file/\\.cs/\\.exe/}"],
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
// By default csc is not in your PATH, so add it to your path
// or uncomment "path" and check that it has correct value
//"path": "C:/Windows/Microsoft.NET/Framework64/v4.0.30319/",
"shell": true, // Without this sublime has hard times to parse "&" in out command line
"selector": "source.cs"
}