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
//. Define some character sets | |
type LowerChar = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | | |
'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | | |
'u' | 'v' | 'w' | 'x' | 'y' | 'z'; | |
type UpperChar = `${Capitalize<LowerChar>}` | |
type AlphaChar = LowerChar | UpperChar; | |
type NumChar = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '0'; | |
type IsType<T extends string, U> = T extends U ? T : never; |
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; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Media; | |
using System.Windows.Media.Animation; | |
namespace WPFAnimations |
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
// Given an interface like this, I can have TypeScript automatically | |
// generate message types from all of the "update" methods below. | |
export interface Person { | |
// We'll ignore these properties | |
name: string; | |
age: number; | |
dob: Date; | |
// We'll ignore any method that returns void (We want methods to return new methods) | |
setDate(newDate: Date): void; |
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 TrustLevel { | |
None, | |
AcceptAllSolutionsTrustLevel | |
} | |
class SomeComponent { | |
private authenticated = false; | |
private isStaff = false; | |
private currentUser = { | |
id: 123, |
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
/// <summary> | |
/// Builds a map where the keys are word signatures and | |
/// each value is the list of words that share that signature. | |
/// The signature of a word is simply a string containing | |
/// the word's letters, sorted. Thus "dog" and "god" will | |
/// both have the signature "dgo", and the entry in the map | |
/// with that key will be those two words. | |
/// | |
/// This let's us quickly find anagrams | |
/// </summary> |
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
Full Metal Jacket |
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
Full Metal Jacket |
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
let items = [ | |
"1 1/2 cup onions, diced" | |
"1/4 tsp coriander" | |
"1 medium carrot" | |
"1.5 oz olive oil" | |
"two lemons" | |
"mint" | |
] | |
let tokenize(s) = [ for t in Regex.Split(s, "\\b") 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
// First, clone the word list project here: https://github.com/dwyl/english-words.git | |
// Then save this file in the same folder and run! | |
open System.IO | |
// Ok... Here's how it works... | |
// First, we load all the words from the Moby text fil | |
let allTheWords = File.ReadAllLines("words.txt") |
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
// 1. Create a project and add Steego.FsPad as a Nuget dependency | |
// 2. Build your project and set this folder to your output | |
#I "bin/Debug/net461/" | |
#r "FSharp.Core.dll" | |
#r "Suave.dll" | |
#r "Steego.FsPad.dll" | |
module Watcher = |