This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$len = (ls -r -filter *.cs | %{ hg blame -u $_.FullName } | ?{ $_ -match '^\s*claco' }).Length; "claco wrote $len lines of code" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpeakerController : Controller | |
{ | |
public ActionResult Create(int presentationId, FormCollection data) | |
{ | |
var presentation = Presentation.Find(presentationId); | |
var vm = SpeakerNewViewModel.Build(presentation); | |
UpdateModel(vm, data); | |
var presentationApi = new PresentationApi(presentationId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{var anEmptyRegex = "";} | |
<script type="text/javascript"> | |
var r = /@anEmptyRegex/i; | |
callSomeFunction(r); | |
</script> | |
-- Razor Output -- | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a Node = 'a * 'a list | |
type 'a Graph = 'a Node list | |
let g = [('a', ['b'; 'd']); ('b', ['a'; 'c'; 'd']); ('c', ['b']); ('d', ['a'; 'b']); ('e', ['f']); ('f', ['e'])] | |
let findConnectedGraph (map : Map<'a, 'a list>) (firstVal : 'a) = | |
let rec walk (seen : 'a list) (tosearch : 'a list) = | |
let isSeen n = | |
seen |> List.exists (fun i -> i=n) | |
let notSeenOnly (nodes : 'a list) = | |
nodes |> List.filter (fun i -> not <| isSeen i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let words = System.IO.File.ReadAllLines("four-char-dictionary.txt") | |
let isWordInDict word = | |
words |> Seq.exists (fun w -> w = word) | |
let filterToDict words = | |
words |> List.filter isWordInDict | |
let filterNotSeen (seen : Set<string>) words = | |
words |> List.filter (fun w -> not(seen.Contains(w))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ContextAttribute.fs | |
module ContextAttribute | |
type ContextAttribute() = | |
inherit System.Attribute() | |
// example_test_file.fs | |
module example_test_file | |
open canopy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$packageConfigs = dir -r -include packages.config -exclude **\.hg\** | %{ $_.FullName } | |
$packageConfigs | %{ nuget.exe install $_ } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Task : ActiveRecord | |
{ | |
public string Name { get; set; } | |
public int AssignedTo_UserId { get; set; } | |
public DateTime DueOn { get; set; } | |
public Task() | |
{ | |
DueOn = DateTime.Now.AddDays(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool HasValue(this ElementScope scope, string text, Options options = null) | |
{ | |
var f = scope.GetType().GetField("options", BindingFlags.Instance | BindingFlags.NonPublic); | |
var config = (Options)f.GetValue(scope); | |
var robustly = new RetryUntilTimeoutRobustWrapper(); | |
return robustly.Robustly(new HasValueQuery(scope, text, options ?? config)); | |
} | |
class HasValueQuery : Query<bool> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ICommand | |
{ | |
} |
OlderNewer