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
"emeraldwalk.runonsave": { | |
"commands": [ | |
{ | |
"match": "\\.go$", | |
"cmd": "go test > ~/tcrfeedback 2>&1 && git commit -am wip || git reset --hard" | |
} | |
] | |
} |
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
#!/usr/bin/env bash | |
if [ "$1" = "" ]; then echo "Usage: gobootstrap.sh kata_name" && exit 1; fi | |
touch $1.go $1_test.go | |
go mod init $1/1 | |
go mod tidy |
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
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set smarttab | |
set number | |
set ai "auto indent | |
set si "smart indent | |
set wrap "wrap lines |
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
[UseReporter(typeof(DiffReporter))] | |
[TestClass] | |
public class TestCombinations | |
{ | |
public string RunLegacyManagerProcessor(string a, int b, bool c) | |
{ | |
if (c) return "42"; | |
if (b > 12) return a.Length.ToString(); | |
return b.ToString(); | |
} |
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 list = | |
stdin.ReadToEnd().Split '\n' | |
|> Array.map(fun x -> int(x)) | |
|> Array.toList |
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 has number list = List.exists (fun elem -> elem = number) list | |
let rec distinct list = | |
match list with | |
[] -> [] | |
| x :: xs when has x xs -> distinct xs | |
| x :: xs -> x :: distinct xs | |
let l = [ 1; 2; 3; 1; 2; 1 ] | |
distinct l |
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
#/usr/bin/python | |
import fdb | |
import time | |
fdb.api_version(21) | |
db = fdb.open () | |
writesCount = 10000 | |
started = time.time() |
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
import Cocoa | |
func fizzBuzz (number : Int) -> String { | |
let (n,m) = (number % 3, number % 5) | |
switch (n,m) { | |
case (n,m) where n == 0 && m == 0: | |
return "FizzBuzz" | |
case (n,m) where n == 0: | |
return "Fizz" | |
case (n,m) where m == 0: |
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
private static async Task Demo() | |
{ | |
var cancellationTokenSource = new CancellationTokenSource(); | |
using (var db = await Fdb.OpenAsync()) | |
{ | |
var partition = db.Partition("my_data"); | |
var firstId = Guid.NewGuid(); | |
var firstSequence = new[] { "foo", "bar", "baz" }; | |
// writing the data: |
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
module FizzBuzz | |
let fizzbuzzNumberProc x = | |
if x % 15 = 0 then "FizzBuzz" | |
elif x % 3 = 0 then "Fizz" | |
elif x % 5 = 0 then "Buzz" | |
else x.ToString () | |
let fizzbuzzNumber x = | |
match x with |