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
| #r "packages/Suave/lib/net40/Suave.dll" | |
| open Suave // always open suave | |
| open Suave.Successful // for OK-result | |
| open Suave.Web // for config | |
| startWebServer defaultConfig (OK "Hello World!") |
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
| List<Person> persons = GetAllPersons(); | |
| var cache = CacheFactory.CreateCache(persons); | |
| cache.AddIndexer(new Indexer<Person, string>(p => p.Name)); | |
| // Returns all persons with name Jane | |
| var janes = cache.Get(p => p.Name, "Jane").ToList(); | |
| cache.AddIndexer(new Indexer<Person, string>(p => p.LastName)); | |
| // Returns all persons with last name Smith | |
| var smiths = cache.Get(p => p.LastName, "Smith").ToList(); |
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
| var cache = CacheFactory.CreateCache(Person.CreateTestData()); | |
| cache.AddIndexer(new Indexer<Person, string>(p => p.Name)); | |
| cache.AddItems(new Person("Jane", "Dow", new DateTime()), new Person("Jill", "Jungle", new DateTime())); |
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.Linq; | |
| using System.Text; | |
| namespace ConsoleApp1 | |
| { | |
| using System.Diagnostics; | |
| using System.Threading.Tasks; |
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
| defmodule Composition do | |
| def inc(x) do | |
| x + 1 | |
| end | |
| def square(x) do | |
| x * x | |
| end | |
| def double(x) do |
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
| def shape(%Tetris.Brick{name: :l}) do | |
| [ | |
| {2, 1}, | |
| {2, 2}, | |
| {2, 3}, {3,3} | |
| ] | |
| end |
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
| def shape(%Tetris.Brick{name: :l}) do | |
| [ | |
| {2, 1}, | |
| {2, 2}, | |
| {2, 3}, | |
| {3, 3} | |
| ] | |
| end |
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
| inputs: | |
| Enum.flat_map(["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], | |
| & Path.wildcard(&1, match_dot: true)) -- ["lib/foo/bar.ex"] |
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
| inputs: | |
| ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] |
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
| ignored_files = [ | |
| "lib/tetris/shape.ex" | |
| ] | |
| [ | |
| inputs: | |
| Enum.flat_map( | |
| ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], | |
| &Path.wildcard(&1, match_dot: true) | |
| ) -- ignored_files |
OlderNewer