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
| killall ssh-agent | |
| eval `ssh-agent` | |
| ssh-add --apple-load-keychain | |
| ssh-add -L |
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
| open System | |
| open System.Diagnostics | |
| [<Sealed>] | |
| type MaybeBuilder () = | |
| [<DebuggerStepThrough>] | |
| member inline __.Return value: 'T option = Some value | |
| [<DebuggerStepThrough>] | |
| member inline __.ReturnFrom value: 'T option = value |
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 (>>=) x f = Option.map f x | |
| let (>>*) x f = Option.bind f x | |
| let third (_, _, c) = c | |
| type Region = Europe | USA | Japan | Others | |
| type Car = { name: string; region: Region; price: decimal; capacity: float } | |
| let taxRateTable = [Europe, [(0.0, 2.0, 1.0m); |
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
| namespace trio { | |
| export var defaultVideoShader: VideoShader; | |
| export class VideoSprite extends PIXI.Sprite { | |
| constructor(texture: PIXI.Texture, withAlpha: boolean = true) { | |
| super(texture); | |
| if (withAlpha) { | |
| if (!defaultVideoShader) { |
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
| namespace trio { | |
| var vertexShader = ` | |
| precision lowp float; | |
| attribute vec2 aVertexPosition; | |
| attribute vec2 aTextureCoord; | |
| attribute vec4 aColor; | |
| uniform mat3 projectionMatrix; |
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
| #include <iostream> | |
| // { 1 2 3 4 } | |
| // { 5 6 7 8 } | |
| // { 9 10 11 12 } | |
| // {13 14 15 16 } | |
| // | |
| // 4 | |
| // 3 8 | |
| // 2 7 12 |
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
| module mytest | |
| open System | |
| open NUnit.Framework | |
| let seq (l: int list) = | |
| let rec helper (acc: int list) (rest: int list) = | |
| match acc, rest with | |
| | [], a :: b -> helper [a] b | |
| | _, [] -> acc |
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 pick items weight = | |
| let rec pick based = | |
| function | |
| | [] -> None | |
| | (w, _) as h :: _ when weight <= w + based -> Some h | |
| | (w, _) :: t -> pick (based + w) t | |
| pick 0.0 items |
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
| module test | |
| open NUnit.Framework | |
| open FsUnit | |
| open System | |
| let min (a: int) (b: int) (c: int) = | |
| Math.Min(a, Math.Min(b, c)) |
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; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApplication1 { | |
| class Test { |
NewerOlder