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
hasura: | |
restart: always | |
image: hasura/graphql-engine:v2.35.1 | |
ports: | |
- "$HASURA_PORT:8080" | |
depends_on: | |
- postgres | |
environment: | |
HASURA_GRAPHQL_DATABASE_URL: $HASURA_GRAPHQL_DATABASE_URL | |
HASURA_GRAPHQL_ENABLE_CONSOLE: $HASURA_GRAPHQL_ENABLE_CONSOLE |
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
#!/usr/bin/env python | |
""" | |
Convert mpg4 into h264 file. | |
src: https://gist.github.com/hipertracker/695ff1ebdd58a8ea463c67da65d292e2 | |
""" | |
import os | |
import sys | |
from moviepy.editor import VideoFileClip |
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 websockets | |
import asyncio | |
import logging | |
import json | |
logger = logging.getLogger('websockets') | |
logger.setLevel(logging.DEBUG) | |
async def user_listener(*, uri: str, query: str, variables: dict = {}, extra_headers: dict = {}, debug: bool = False) -> None: | |
if debug: |
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
SELECT | |
usename, | |
pid, | |
client_addr, | |
STATE, | |
age( clock_timestamp(), query_start ), | |
query, | |
query_start, | |
wait_event_type, | |
wait_event, |
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
with sequences as ( | |
select * | |
from ( | |
select table_schema, | |
table_name, | |
column_name, | |
pg_get_serial_sequence(format('%I.%I', table_schema, table_name), column_name) as col_sequence | |
from information_schema.columns | |
where table_schema not in ('pg_catalog', 'information_schema') | |
) t |
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
<script setup> | |
import { useClient } from "villus"; | |
import {graphqlOptions} from "@/grapql/client" | |
//... | |
useClient(graphqlOptions); | |
</script> |
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
// src/boot.ts | |
import {createClient, defaultPlugins, handleSubscriptions} from "villus"; | |
import {SubscriptionClient} from "subscriptions-transport-ws"; | |
import {boot} from "quasar/wrappers"; | |
import {OperationOptions} from "subscriptions-transport-ws/dist/client"; | |
const subscriptionClient = new SubscriptionClient(import.meta.env.VITE_HASURA_WEBSOCKET, {}); | |
const subscriptionForwarder = (operation: OperationOptions) => subscriptionClient.request(operation); |
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 os | |
def rename_folders(path, dirs, src, dst): | |
for name in os.listdir(path): | |
if re.match(dirs, name): | |
name2 = re.sub(src, dst, name) | |
filepath1 = path + os.sep + name | |
filepath2 = path + os.sep + name2 | |
os.rename(filepath1, filepath2) | |
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 itertools | |
import json | |
import re | |
from typing import List | |
def group(_input): | |
d = list(itertools.chain(*list(map(lambda x: list(x.items()), _input)))) | |
_s = [[a, [c for _, c in b]] for a, b in itertools.groupby(sorted(d, key=lambda x: x[0]), key=lambda x: x[0])] | |
return {a: group(b) if all(isinstance(i, dict) for i in b) else list(itertools.chain(*b)) for a, b in _s} |
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
<template> | |
<q-btn-dropdown :label="locale" dense flat> | |
<q-list | |
v-for="(label, loc) in allowedLocales" | |
:key="loc" | |
:class="bgTheme" | |
dense | |
> | |
<q-item | |
v-close-popup |
NewerOlder