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
return connectorType.
GetCustomAttribute<ConfigurationNameAttribute>(inherit: true).
ToMaybe().
Select(x => x.Name).
Return(@default: connectorType.Name);
describe("StringCalculator", function () {
describe("Given empty strings", function(){
it('Should return 0', function(){
expect(calculate("")).toBe(0);
});
});
describe("Given any positive number", function(){
it('Should return given number', function(){
using System;
using System.Security;
using System.Web.Mvc;
using NSubstitute;
using Xunit;
namespace MultiConnector.Web
{
using Auth;
using Modules.Authentication;
#region IDisposable Members
public static void Dispose()
{
container.Dispose();
}
#endregion
@rarous
rarous / ant.js
Created April 11, 2014 08:26
#6 coding dojo
var white = 'x';
var black = 'y';
var north = {o:"N"};
var east = {o:"E"};
var south = {o:"S"};
var west = {o:"W"};
north.right = function() { return east; }
north.left = function() { return west; }
east.right = function() { return south;}
@rarous
rarous / plugin.edn
Last active August 29, 2015 14:00
My user.keymap
{:desc "TODO",
:version "0.0.1",
:source "TODO",
:behaviors "user.behaviors",
;; Do not edit - :dependencies are auto-generated
:dependencies {
"Bracket glow" "0.0.2",
"CSS" "0.0.6",
"Clojure" "0.1.1",
"Emmet" "0.0.2",
modifier = <'.'> (title|classes|styles|align)*
title = <'('> #"[^\)]*" <')'>
classes = <'['> ident? (<ws> ident)* <']'>
styles = <'{'> declaration* <'}'>
align = halign|valign|halign valign|valign halign|ε
declaration = property <":" ows> value <";"?>
ws = #"\s+"
ows = #"\s*"
ident = #"#?-?[_a-zA-Z][_a-zA-Z0-9-]*"
property = #"-?[a-zA-Z][_a-zA-Z0-9-]*"
#define LOG
using System;
using System.IO;
using System.Net;
using System.Xml;
using System.Text;
using System.Threading;
using System.Net.Sockets;
using System.Collections;
@rarous
rarous / bmi.php
Last active August 29, 2015 14:05
<?php namespace BodyMassIndex;
abstract class Thresholds {
const UNDERWEIGHT = 18.5;
const OVERWEIGHT = 25;
const OBESE = 30;
}
/**
* Calculates Body Mass Index.
@rarous
rarous / bmi.clj
Last active August 29, 2015 14:05
(ns body-mass-index.core)
(defn calc [mass height]
(/ mass (* height height)))
(defn category [bmi]
(cond
(> bmi 30) ::obese
(> bmi 25) ::overweight
(< bmi 18.5) ::underweight