Skip to content

Instantly share code, notes, and snippets.

View powerc9000's full-sized avatar
🧺

Clay Murray powerc9000

🧺
View GitHub Profile
CoRoutineThing :: struct {
func: proc(context: ^CoRoutineThing),
other: int,
data: int,
whatever: int
}
resumable_proc :: proc(routine_context: ^CoRoutineThing) {
// 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) {
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,
{
"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",
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();
}
//Some feature
if(isEnabled("some_feature")){
//Do the feature
} else {
//The feature isn't ready!
}
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
}
const req = await fetch("https://a.dropconfig.com/d21deb7f-f6ad-428d-be4d-c20cbffa2f3d.json");
const flags = await req.json();
{
"flags": [
{
"name": "some_feature",
"enabled": false
}
]
}
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.