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
/** | |
* Create a configuration getter that reads from command line arguments, environment variables, | |
* and a .env file in the priority. | |
* @param args Result of deno std's [parseArgs](https://deno.land/std/cli/parse_args.ts) | |
* @param getEnv Function to get environment variables | |
* @param dotEnv Record from a .env file | |
* @returns A function that returns the value for a configuration parameter | |
*/ | |
export function configSource<T>( | |
{ args, getEnv, dotEnv }: { |
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
/** | |
* Multiplexes multiple async iterators into a single async iterable iterator. | |
* @param args An array of async iterators to be multiplexed. | |
* @returns An async iterable iterator that yields values immediately from iterators. | |
*/ | |
export async function* multiplex<T, N>( | |
args: readonly AsyncIterator<T, void, N>[], | |
): AsyncIterableIterator<T> { | |
const promises = new Map<AsyncIterator<T, unknown, N>, ReturnType<typeof step<T, N>>>(); | |
args.forEach((iterator) => promises.set(iterator, step(iterator))); |
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
export function atomFamilyStrict< | |
Key, | |
Args extends unknown[], | |
AtomType extends { | |
onMount?: (set: (...args: Args) => void) => void | (() => void); | |
}, | |
>(initializeAtom: (param: Key) => AtomType) { | |
const atoms = new Map<string, AtomType>(); | |
const family = (key: Key) => { |
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 com.facebook.react.utils.KotlinStdlibCompatUtils.toBooleanStrictOrNullCompat | |
import java.util.Properties | |
plugins { | |
id("com.android.application") | |
id("com.facebook.react") | |
} | |
apply(from = "../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle") | |
val applyNativeModulesAppBuildGradle: groovy.lang.Closure<Any> by extra |
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 { parse } from "https://deno.land/x/ini@v2.1.0/mod.ts"; | |
import { parseFlags } from "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/mod.ts"; | |
type Config = { profile?: string; serial?: string }; | |
let fileConfig: undefined | Config; | |
if (import.meta.main) { | |
await main(); | |
} |
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
extension ObjectExt<T> on T { | |
R let<R>(R Function(T) x) => x(this); | |
} | |
class ProgramCardDataFamily { | |
const ProgramCardDataFamily(); | |
ProgramCardDataProvider call( int data) { | |
return ProgramCardDataProvider( data); | |
} |
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 { expandGlob } from "https://deno.land/std@0.165.0/fs/expand_glob.ts"; | |
main().catch(console.error); | |
async function main() { | |
const osEscaper = Deno.build.os === "windows" ? "`" : "\\"; | |
const readPromises: Promise<string>[] = []; | |
for await (const path of Deno.args) { | |
const escaped = path.replace(/(\[|\])/g, (_, arg) => `${osEscaper}${arg}`); | |
for await (const entry of expandGlob(escaped, { extended: false })) { |
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
// ==UserScript== | |
// @name Open notion in app | |
// @namespace https://gist.github.com/jeiea/514c8c0862710cc04aa9cbb5ac465c84 | |
// @downloadURL https://gist.github.com/jeiea/514c8c0862710cc04aa9cbb5ac465c84/raw/open_in_notion.user.js | |
// @version 0.3 | |
// @description Useful with slack integration. | |
// @author jeiea | |
// @match https://www.notion.so/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so | |
// @grant window.close |
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
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !! | |
Dart Code extension: 3.34.0 | |
Flutter extension: 3.34.0 (activated) | |
App: Visual Studio Code | |
Version: 1.64.0 | |
Platform: win | |
Workspace type: Flutter |
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
const makePageNavigator = ref => { | |
let currentPage; | |
let ratio; | |
let ignoreIntersection = false; | |
const resetAnchor = entries => { | |
const container = ref.current; | |
if (!container?.clientHeight || entries.length === 0) { | |
return; |
NewerOlder