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
| CoRoutineThing :: struct { | |
| func: proc(context: ^CoRoutineThing), | |
| other: int, | |
| data: int, | |
| whatever: int | |
| } | |
| resumable_proc :: proc(routine_context: ^CoRoutineThing) { |
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
| // This struct can be anything you want. It will just get passed to our iterator function for each iteration. | |
| // Just an example. | |
| MyCustomIterator :: struct { | |
| data: []string //Can be any data | |
| index: int, | |
| length: int | |
| } | |
| iterate_my_type :: proc(it: ^MyCustomIterator) -> (value: string, index: int, ok: bool) { |
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
| package raylib | |
| RAYLIB_KEYS :: enum { | |
| // Alphanumeric keys | |
| KEY_APOSTROPHE = 39, | |
| KEY_COMMA = 44, | |
| KEY_MINUS = 45, | |
| KEY_PERIOD = 46, | |
| KEY_SLASH = 47, | |
| KEY_ZERO = 48, |
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
| { | |
| "documents": [ | |
| { | |
| "name": "Post-2019-06-03", | |
| "id": "9587bc75-0f64-4c55-b115-2d1be1bbdf19", | |
| "repo": "1084e9dc-3926-4b73-9b10-f1eb21eb3a06", | |
| "org": "dbfc175f-1117-4c3f-8763-c4bc292d90d7", | |
| "internal_tags": {}, | |
| "privacy": "PUBLIC", | |
| "updated": "2019-06-03T15:35:24.824Z", |
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
| async function fetchPosts(org, repo) { | |
| const req = await fetch( | |
| `https://api.dropconfig.com/api/documents?org=${org}&repo=${repo}&expand=publications` | |
| ); | |
| const res = await req.json(); | |
| } |
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
| //Some feature | |
| if(isEnabled("some_feature")){ | |
| //Do the feature | |
| } else { | |
| //The feature isn't ready! | |
| } |
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
| function isEnabled(flagName){ | |
| const flag = flags.find((flag)=>{ | |
| return flag.name === flagName | |
| }) | |
| //If the flag doesnt exist it sure isn't enabled | |
| if(!flag){ | |
| return false | |
| } | |
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
| const req = await fetch("https://a.dropconfig.com/d21deb7f-f6ad-428d-be4d-c20cbffa2f3d.json"); | |
| const flags = await req.json(); |
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
| { | |
| "flags": [ | |
| { | |
| "name": "some_feature", | |
| "enabled": false | |
| } | |
| ] | |
| } |
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
| const configUrl = "https://a.dropconfig.com/1291ea92-845b-46a4-a020-74bf0c5e72f4.json" | |
| let translations = null; | |
| async function loadTranslations(lang){ | |
| const req = await fetch(configUrl); | |
| const data = await req.json(); | |
| // We will want a better system to find out the language etc. | |
| // But this will do for now. |
NewerOlder