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 range = function*(start, end){ | |
let current = start; | |
while(current < end){ | |
let newValue = yield current; | |
current = newValue ? newValue : current + 1; | |
} | |
}; | |
let stuff = range(0,3) |
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 range = function*(start, end){ | |
for(var i = start; i <= end; i++){ | |
yield i; | |
} | |
}; | |
let n = [for (x of range(0,3)) x]; | |
expect(n).toEqual([0,1,2,3]); |
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
// this: | |
var foo = "hi!"; | |
var length = foo?.Length; | |
// will create this: | |
string str = "hi!"; | |
int? nullable = str != null ? new int?(str.Length) : new int?(); | |
// while this: | |
var foo = "hi!"; |
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 generatedCode = generator.TransformText(); | |
var comparer = DesktopAssemblyIdentityComparer.Default; | |
var options = new CSharpCompilationOptions( | |
OutputKind.DynamicallyLinkedLibrary, | |
assemblyIdentityComparer:comparer); | |
var tree = SyntaxFactory.ParseSyntaxTree(generatedCode); | |
var compilation = CSharpCompilation | |
.Create("measures.dll") |
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
protected override IEnumerable<IValueSetCode> GetEntries(bool negation) | |
{ | |
// we currently are not importing allergies, but they should be here soon ... | |
if (DateTime.Now > new DateTime(2015, 3, 1)) | |
{ | |
throw new NotSupportedException("We still have no allergies imported!"); | |
} | |
return Enumerable.Empty<IValueSetCode>(); | |
} |
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
<configuration> | |
<appSettings> | |
<add key="ClientValidationEnabled" value="true"/> | |
<add key="UnobtrusiveJavaScriptEnabled" value="true"/> | |
</appSettings> | |
</configuration> |
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 Employee | |
{ | |
public Employee() | |
{ | |
HomeAddress = new Address(); | |
} | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public Address HomeAddress { get; set; } |
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
npm install foo --msvs_version=2012 |
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 Foo | |
{ | |
public Foo(int value) | |
{ | |
_value = value; | |
} | |
int _value; | |
} |
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
using static System.Console; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
WriteLine("This works..."); | |
} |