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
| # How to connect Figma MCP to OpenAI Codex | |
| 1. Open `~/.codex/config.toml` and add these lines: | |
| ```toml | |
| [features] | |
| rmcp_client = true | |
| [mcp_servers.figma] | |
| url = "https://mcp.figma.com/mcp" | |
| ``` |
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
| // Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3. | |
| #![feature(ordering_chaining, step_by)] | |
| fn main() { | |
| // linq5: Where - Indexed | |
| /* | |
| //c# | |
| public void Linq5() | |
| { |
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
| go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt | |
| go tool pprof -http :8080 cpu.out | |
| go tool pprof -http :8081 mem.out | |
| go tool trace trace.out | |
| go tool pprof $FILENAME.test cpu.out | |
| # (pprof) list <func name> | |
| # go get -u golang.org/x/perf/cmd/benchstat | |
| benchstat bench.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
| [<AutoOpen>] | |
| module IO = | |
| type IO<'a> = | |
| private | |
| | Return of (unit -> 'a) | |
| | Suspend of (unit -> IO<'a>) | |
| let rec run x = | |
| match x with | |
| | Return v -> v() |
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
| // General hints on defining types with constraints or invariants | |
| // | |
| // Just as in C#, use a private constructor | |
| // and expose "factory" methods that enforce the constraints | |
| // | |
| // In F#, only classes can have private constructors with public members. | |
| // | |
| // If you want to use the record and DU types, the whole type becomes | |
| // private, which means that you also need to provide: | |
| // * a constructor function ("create"). |
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 type Functor = sig | |
| type 'a t | |
| val map : ('a -> 'b) -> 'a t -> 'b t | |
| end | |
| module type Monad = sig | |
| type 'a t | |
| val map : ('a -> 'b) -> 'a t -> 'b t | |
| val return : 'a -> 'a t |
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
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ; Copyright (c) Rich Hickey. All rights reserved. | |
| ; The use and distribution terms for this software are covered by the | |
| ; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
| ; which can be found in the file CPL.TXT at the root of this distribution. | |
| ; By using this software in any fashion, you are agreeing to be bound by | |
| ; the terms of this license. | |
| ; You must not remove this notice, or any other, from this software. | |
| ;dimensions of square world |