This file contains 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
import json | |
import subprocess | |
import uuid | |
from pathlib import Path | |
from typing import Dict | |
import asyncio | |
import aiohttp | |
import modal | |
# Time to wait between API check attempts in milliseconds |
This file contains 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 handleGithubDeviceFlow(clientId) { | |
const a = await fetch("https://github.com/login/device/code", { | |
method: "POST", | |
body: JSON.stringify({ | |
client_id: clientId, | |
scope: "user", | |
}), | |
headers: { | |
Accept: "application/json", | |
"Content-Type": "application/json", |
This file contains 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
import useSWR from 'swr'; | |
const fetcher = (url: string) => fetch(url).then((res) => res.json()); | |
function NpmPackageInstaller({ | |
name, | |
}: { | |
name: string; | |
}) { | |
const { data, error } = useSWR(`https://registry.npmjs.org/${name}`, fetcher); |
This file contains 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
//visible[0] is an AnimBool, you can cache it somewhere in your custom editor. | |
using (new EditorUtils.FoldoutScope(visible[0], out var shouldDraw, "SongItem")) | |
{ | |
if (shouldDraw) | |
{ | |
//draw the rest of your GUI. | |
songItem = EditorGUILayout.ObjectField(songItem, typeof(SongItem), false) as SongItem; | |
} | |
} |
This file contains 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
/* | |
* Copyright (C) 2016 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |