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
import Foundation | |
struct SampleTurtleProgram { | |
private var instructions: [Instruction] = { | |
let getTurtleReady = [ | |
Instruction.Move(0.5), | |
.Rotate(-M_PI_2), | |
.Move(0.5), |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Nancy; | |
using Nancy.Helpers; | |
using Nancy.Hosting.Self; | |
using RestSharp; |
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
using System; | |
using AutoMapper; | |
namespace Some.Namespace | |
{ | |
public class ConvertSpecifiedDateTime : ITypeConverter<DateTime, DateTime?> | |
{ | |
public DateTime? Convert(ResolutionContext context) | |
{ | |
var sourceMember = context.PropertyMap.SourceMember; |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Xml; | |
using System.Xml.Linq; | |
namespace ConsoleApplication7 | |
{ | |
internal class Program |
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
@model DateFields | |
@Html.TextBoxFor(x => x.Day, new {placeholder = "DD", maxlength = 2, @class = "form-control form-control--dob"}) | |
@Html.TextBoxFor(x => x.Month, new {placeholder = "MM", maxlength = 2, @class = "form-control form-control--dob"}) | |
@Html.TextBoxFor(x => x.Year, new {placeholder = "YYYY", maxlength = 4, @class = "form-control form-control--dob"}) |
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
extension Array { | |
func any(_ predicate: (Element) throws -> Bool) rethrows -> Bool { | |
for e in self { | |
if try predicate(e) { | |
return true | |
} | |
} | |
return false |
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
enum Action { | |
case tookOne | |
case wentToStore | |
} | |
struct Verse { | |
let countBeforeAction: Int | |
let action: Action | |
let countAfterAction: Int | |
} |
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
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace AvailSpike | |
{ | |
[TestFixture] | |
public class UseCase | |
{ | |
[Test] |
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
import Foundation | |
protocol Cipher { | |
func encrypt(message: String, secret: Int) -> String | |
func decrypt(message: String, secret: Int) -> String | |
} | |
struct XOR: Cipher { | |
private func impl(message: String, secret: Int) -> String? { |