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
using System;
using System.Collections.Specialized;
using System.Text;
using System.Web;
using System.Web.Mvc;
using log4net;
/// <summary>
/// Filter pro logování vyjímek pomocí log4net.
/// </summary>
@rarous
rarous / less-helper.js
Created May 11, 2011 07:22
Helper for less compiler via jshost.exe
LoadModule('jsstd');
LoadModule('jsio');
var thisDir = arguments[0].replace(/[^\\/]+$/, '');
var srcFile = arguments[1];
var dstFile = arguments[2];
var window = {
location: {
port: 80,
@rarous
rarous / GeneratorExtensions.cs
Created May 25, 2011 11:43 — forked from renestein/gist:988359
BuildergenerovaniKolekceObjektu.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Builder_Algida_Row_Generator
{
class GeneratorExtensions
{
public LinkedList<TReturn> ApplyFunctionsWithHistory<TA1, TReturn>(TReturn arg1, TA1 arg2,
Task Deploy-Web -depends Update-WebConfig, Create-Stylesheets {
$webproj = Join-Path $WebProj_dir 'SmartWeb.Web.csproj'
Deploy-Package $webproj $Configuration $Package $Dest $SiteName $UserName $Pwd
}
Task Update-WebConfig {
$webConfig = Join-Path $WebProj_dir "Web.config"
$now = Get-Date -format 'yyyy-MM-dd HH:mm'
Write-Host "Updating version number to: #$Version"
open Microsoft.FSharp.MLLib.Sys
let cmdArgs = argv
<figure style="float:left"><img src=""><figcaption>text</figcaption></figure>
open System
open System.Collections
open System.Collections.Generic
open System.IO
open System.Text
open System.Text.RegularExpressions
open System.Xml.Linq
open Microsoft.FSharp.Collections
type Source =
while ($true) { "Zeptej se mě za 30 minut."; start-sleep -s 1800 }
public class GuidConstraint : IRouteConstraint
{
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
{
if (!values.ContainsKey(parameterName))
return false;
string stringValue = values[parameterName] as string;
if (string.IsNullOrEmpty(stringValue))
return false;
@rarous
rarous / Global.asax.cs
Created August 28, 2011 09:23
Prevent instant requests
protected void Application_BeginRequest() {
if (String.Equals("instant", Request.Headers["X-Purpose"], StringComparison.OrdinalIgnoreCase)) {
Response.StatusCode = 403;
CompleteRequest();
}
}