Skip to content

Instantly share code, notes, and snippets.

Hacking fast and slow.

Anton Vynogradenko Restuta

Hacking fast and slow.
View GitHub Profile
Restuta / StringExtensions.cs
Created Aug 26, 2010
Various useful System.String extensions
View StringExtensions.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AutoAssemblyVersion
/// <summary>
/// Contains string extensions.
/// </summary>
Restuta / CsvFieldsSaver.cs
Created Sep 22, 2010
CsvFieldsSaver + Tests
View CsvFieldsSaver.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Restuta;
using System.Text;
namespace Restuta.FieldSavers
/// <summary>
View gist:593506
while not inFSO.FileExists(pdfFileName1) and not inFSO.FileExists(pdfFileName2)
ExecuteSQL("waitfor DELAY '00:00:02'")
View gist:740340
Enumerable.Range(0, 1000000)
.Agregate((x, y) => x + y);
Restuta / gist:812753
Created Feb 5, 2011
Tanahas first programm =)
View gist:812753
<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 / gist:1772878
Created Feb 8, 2012
find a thread safety bug
View gist:1772878
using System;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication3
class ThreadUnsafe
public static int _val1 = 1;
public static int _val2 = 1;
Restuta /
Created Feb 15, 2012 — forked from chaliy/
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 / mspec-equality-tests.cs
Created Mar 1, 2012 — forked from kolesnick/mspec-equality-tests.cs
ReSharper template for MSpec tests of Equals method and == operator
View mspec-equality-tests.cs
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.
$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 / gist:1947397
Created Mar 1, 2012
Measure.Performance (Simplifies work with Stopwatch class)
View gist:1947397
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 / C#.sublime-build
Created Mar 19, 2012 — forked from chaliy/C#.sublime-build
Sublime Build to compile and run C# program
View C#.sublime-build
// 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"