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
public ActionResult SignIn(string returnUrl = null)
{
if (returnUrl != null)
Response.StatusCode = (int)HttpStatusCode.Unauthorized;
return View(new SignInRequest { ReturnUrl = returnUrl });
}
<link rel="stylesheet" type="text/css" href="/cdn/css/basic.css?v=204r866" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="stylesheet" media="only screen and (max-width: 960px)" href="/cdn/css/960.css" />
<link rel="stylesheet" media="only screen and (max-width: 890px)" href="/cdn/css/890.css" />
<link rel="stylesheet" media="only screen and (max-width: 750px)" href="/cdn/css/768.css" />
<link rel="stylesheet" media="only screen and (max-width: 480px)" href="/cdn/css/480.css" />
(require '[clojure.core.async :as async :refer :all])
(defn customer [i ch]
(go (>! ch i)))
(defn barber [ch]
(go (while true
(println "cuts hair of " (<! ch)))))
(let
public static ComponentRegistration<TService> RouteFromName<TService>(this ComponentRegistration<TService> registration)
where TService : class
{
return registration.Route(registration.Name);
}
public static ComponentRegistration<TService> Route<TService>(this ComponentRegistration<TService> registration, string name)
where TService : class
{
var factory = new DefaultServiceHostFactory();
@rarous
rarous / 1.cs
Last active February 16, 2021 14:13
static string TryGetErrorMessage(XElement html)
{
var errMessage = html.GetElementsByClassName("ErrorMessage").FirstOrDefault();
var errText = html.GetElementsByClassName("ErrorText").FirstOrDefault();
var errorMessage = String.Empty;
if (errMessage != null && (!errMessage.Attributes("style").Any() || (errMessage.Attributes("style").Any() && errMessage.Attributes("style").First().Value != "visibility:hidden;")))
errorMessage = errMessage.Value.Trim();
if (errText != null)
errorMessage = errText.Value.Trim();
return errorMessage;
function Rebase-Tf {
git stash
git tf fetch
git rebase FETCH_HEAD
git stash pop
}
@rarous
rarous / 1.cs
Last active December 18, 2015 16:48
public class PublishedAccount
{
readonly DateTime publishedDate;
readonly Maybe<DateTime> publishedDateEnd;
readonly AccountTypeStandard standardAccount;
readonly AccountTypeNonstandard nonstandardAccount;
public PublishedAccount(DateTime publishedDate, Maybe<DateTime> publishedDateEnd, AccountTypeStandard standardAccount, AccountTypeNonstandard nonstandardAccount)
{
this.publishedDate = publishedDate;
Although great science is always the result of collaboration, keep in mind that,
like Albert Einstein and his cousin Terry, history will only remember one of you.
@rarous
rarous / FeatureToggles.cs
Created June 11, 2013 15:19
Feature toggles support in Windsor container
using System;
using System.Linq;
using Castle.MicroKernel;
using Castle.MicroKernel.Registration;
namespace Project.Installers {
public static class FeatureToggles {
static readonly string[] OnStates = { "on", "enabled" };
var typText = response.Descendants("typText").FirstOrDefault() != null
? response.Descendant("typText").Value.ToMaybe()
: null;