This file contains 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 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 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 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 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 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 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 | |
{ | |
} |
This file contains 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 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 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
param ( | |
[Parameter(Position=0)] | |
$Tasks | |
#... other params | |
) | |
function IsVersionCompatible($requiredVersion, $testVersion) { | |
# same major, and AT LEAST the required minor and build | |
$testVersion.Major -eq $requiredVersion.Major ` | |
-and $testVersion.Minor -ge $requiredVersion.Minor ` |
OlderNewer