Skip to content

Instantly share code, notes, and snippets.

View rarous's full-sized avatar
💭
I may be slow to respond.

Aleš Roubíček rarous

💭
I may be slow to respond.
View GitHub Profile
@rarous
rarous / gist:3897226
Created October 16, 2012 04:25 — forked from kolman/gist:1427422
Game of Life rules
module CodeRetreat
open Xunit
type Cell =
| DeadCell of int
| LiveCell of int
let hasChanceToLife (cell:Cell) =
match cell with
@rarous
rarous / gist:3840248
Created October 5, 2012 14:52
AngularJS TypeScript definition file
if (content.Contains("dDwtMTcyMjY0OTc3Mjt0PDtsPGk8MT47PjtsPHQ8O2w8aTwxPjtpPDQ+O2k8Nj47aTw4PjtpPDEwPjtpPDEyPjtpPDE0Pjs+O2w8dDw7bDxpPDE"))
{
throw new AccessDeniedException("Old viewstate found.");
}
var items = CreateRequestUris(requestXml).
Select(Downloader.Download).
SelectMany(Parse);
return new Response(TransformResult(items));
@rarous
rarous / gist:3794606
Created September 27, 2012 15:23
Dark side of the C#
readonly int source;
readonly int from;
readonly int to;
Data(int source, int from, int to)
{
this.source = source;
this.from = from;
this.to = to;
}
@rarous
rarous / gist:3794066
Created September 27, 2012 13:40
Setup Build Server checklist
[ ] Install Visual Studio with all stuff you need
[ ] Install FxCop
[ ] Install Code Metrics Power Tool (http://www.microsoft.com/en-us/download/details.aspx?id=9422w)
[ ] Install TeamCity
[ ] Install NuGet (via TeamCity admin console)
On port 80
==========
[ ] Disable World Wide Web Service
[ ] Disable Web Deployment Agent Service
@rarous
rarous / WindsorExtensions.cs
Created September 20, 2012 13:09
Extension for safe registration of Facility
using System.Linq;
using Castle.MicroKernel;
using Castle.Windsor;
public static class WindsorExtensions
{
public static IWindsorContainer AddFacilitySafe<TFacility>(this IWindsorContainer container)
where TFacility : class, IFacility, new()
{
if (container.Kernel.GetFacilities().Any(x => x.GetType() == typeof(TFacility)))
@rarous
rarous / linq.cs
Created September 6, 2012 16:17 — forked from vhenzl/gist:3657030
from x in list
where x
let y = new { X = x }
orderby y.X
select y;
private static bool ProxyTypeMatch(ProxyServerType server, RequiredProxyType required)
{
switch (required)
{
case RequiredProxyType.Any:
switch (server)
{
case ProxyServerType.Http:
case ProxyServerType.Socks4:
case ProxyServerType.Socks5:
@rarous
rarous / gist:3529050
Created August 30, 2012 13:56
Generate MetaProj file from solution
$env:MSBuildEmitSolution=1
msbuild FooBar.sln /t:ValidateSolutionConfiguration
$env:MSBuildEmitSolution=0