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 / Fail.cs
Created September 22, 2010 12:42
using User = RootNS.SubNS.User;
namespace RootNS.AnotherSubNS {
class Test {
User = new RootNS.SubNS.User();
}
}
@rarous
rarous / gist:593822
Created September 23, 2010 15:40 — forked from steida/gist:593816
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Matters.Helpers;
using HtmlAgilityPack;
namespace Matters.Helpers
{
/*
var allowedItems = from pair in dict
where IsAllowed(pair.Key)
select pair.Value;
@rarous
rarous / restore-db.ps1
Created October 29, 2010 09:19
Skript pro obnovu databaze z backupu
$bak_folder = "c:\backups\db"
$sql_server_user = "sa"
$sql_server_pwd = "P4$$w0rd"
$databases = @{ "DbName"="db.bak" }
function Restore-Backups {
foreach ($db in $databases.keys) {
public const string CharUnicodeFormat = "&#{0};";
public static string EncodeUnicodeChars(this string text) {
if (text == null) {
throw new ArgumentNullException("text");
}
return text.Aggregate(
new StringBuilder(),
<nav class="breadcrumbs">
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/books" itemprop="url">
<span itemprop="title">Books</span>
</a> ›
<span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/fiction" itemprop="url">
<span itemprop="title">Fiction</span>
</a> ›
<span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
@rarous
rarous / web.config
Created December 15, 2010 15:37
Nastavení cachování statického obsahu a gzipování výstupu na IIS7
<system.webServer>
<staticContent>
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
<urlCompression doDynamicCompression="true" doStaticCompression="true" />
</system.webServer>
@rarous
rarous / register.cs
Created January 5, 2011 11:56
registrace HttpContextu do Windsor Containeru
Register(
Component.
For<HttpRequestBase>().
LifeStyle.PerWebRequest.
UsingFactoryMethod(() => new HttpRequestWrapper(HttpContext.Current.Request)),
Component.
For<HttpContextBase>().
LifeStyle.PerWebRequest.
UsingFactoryMethod(() => new HttpContextWrapper(HttpContext.Current))
@rarous
rarous / DomainData.cs
Created February 1, 2011 16:10
Domain routing
using System;
namespace Rarous.Web.Routing
{
public class DomainData
{
public string Protocol { get; set; }
public string HostName { get; set; }
public string Fragment { get; set; }
}
@rarous
rarous / closure.ps1
Created March 2, 2011 11:09
Closure deps.js generator
function Write-JsDeps {
param($root, $prefix, $exclusion)
"// This file was autogenerated"
"// Please do not edit."
Get-ChildItem $root -Recurse -Include *.js -Exclude $exclusion | sort FullName |
%{ Create-DepsLine $root $prefix $_.FullName }
}