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
declare @number int | |
set @number = 1 | |
select case @number when 1 | |
then 'yes' | |
else 'no' | |
end as NumberOrYes |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Nancy; | |
using Nancy.Owin; | |
using Nowin; |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Nancy; | |
using Nancy.Owin; | |
using Nowin; |
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 Appointment : IAggregateRoot | |
{ | |
public Appointment(Guid id, AppointmentType type, .....) | |
{ | |
switch type | |
{ | |
case: AppointmentType.TypeOne | |
Apply(new TypeOneAppointmentCreated()); | |
case: AppointmentType.TypeTwo | |
Apply(new TypeTwoAppointmentCreated()); |
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
open System | |
open Nancy | |
open Nancy.Hosting.Self | |
let (?) (parameters:obj) param = | |
(parameters :?> Nancy.DynamicDictionary).[param] | |
let sayHello(name) = | |
"hello " + name |
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
open System | |
open System.Text.RegularExpressions | |
let matcher(s) = | |
let regex = new Regex("^[0-9]{2}$") | |
let matched = regex.Match(s) | |
matched.Success | |
let stringOne = matcher "dom" // false | |
let stringTwo = matcher "12" // true |
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
#r "FSharp.Data.TypeProviders.dll" | |
#r "System.Data.Linq.dll" | |
open System | |
open System.Linq | |
open System.Data | |
open Microsoft.FSharp.Data.TypeProviders | |
open System.Text.RegularExpressions | |
[<Literal>] |
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
open System.Windows.Forms | |
open System.Threading.Tasks | |
let createForm() = | |
let form = new Form() | |
let button = new Button() | |
button.Text <- "Start" | |
form.Controls.Add(button) |
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 fs = require('fs'); | |
function fileEndsWith(fileName, suffix) { | |
return fileName.indexOf(suffix, fileName.length - suffix.length) !== -1; | |
}; | |
var dir = './tmp/'; | |
fs.readdir(dir, function(err, files) { | |
if (err) throw err; |
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 people = [ | |
{ name:"dom", age:22} | |
, { name:"paddy", age:22} | |
, { name:"pete", age:22} | |
, { name:"dick", age:100} | |
] | |
var query1 = { field: "age", found: function(field) { | |
if(field > 50) { | |
return true; |
OlderNewer