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
-- Courtesy of Erwin Brandstetter | |
-- https://dba.stackexchange.com/a/117661 | |
-- | |
-- new_db = new solitary database | |
-- new_sch = private schema for new database | |
-- db_admin = db_mng privileges + create/drop tables privileges | |
-- db_mng = db_user privileges + insert/update/delete privileges | |
-- db_user = select privilege only | |
-- | |
-- psql -U postgres |
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
#include <stdarg.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
int get_string_length(char* string) { | |
int size = 0; | |
while (*string != '\0') { | |
size += 1; | |
string += 1; |
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
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <time.h> | |
char* get_substring(char* string, int start_idx, int end_idx) { | |
int total_len = end_idx - start_idx; | |
char* result = malloc(sizeof(char) * total_len); |
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
if (!globalThis.IDBFactory.prototype.databases) { | |
const KEY = 'IDB_DATABASES_POLYFILL'; | |
globalThis.IDBFactory.prototype.databases = function databases() { | |
const serialized = globalThis.localStorage.getItem(KEY); | |
return Promise.resolve(serialized ? JSON.parse(serialized) : []); | |
}; | |
const listener = async (event) => { | |
const { name, version } = event.target.result; |
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
interface GeneratorFunction extends Function { | |
all: typeof all, | |
allSettled: typeof allSettled, | |
any: typeof any, | |
race: typeof race, | |
resolve: typeof resolve, | |
reject: typeof reject, | |
} | |
type GeneratorYieldType<TGenerator extends Generator> = TGenerator extends Generator<infer TYield, any, any> ? TYield : unknown; | |
type GeneratorReturnType<TGenerator extends Generator> = TGenerator extends Generator<any, infer TReturn, any> ? TReturn : unknown; |