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 trackNameUpdateInterval = 1000 | |
const retryInterval = 500 | |
const streamUrl = 'https://bhmnts.out.airtime.pro/bhmnts_a' | |
const metaUrl = 'https://bohem.herokuapp.com/metadata' | |
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( | |
navigator.userAgent | |
) | |
const audio = new Audio(streamUrl) |
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 pathExtra = require('path-extra') | |
const { exec } = require('child_process') | |
const DIRECTIONS = { | |
UP: 'UP', | |
DOWN: 'DOWN' | |
} | |
const _isInstructionClose = (before, current) => { | |
const isSameEndTime = before.end >= current.start |
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 or replace function app.graphql_subscription() returns trigger as | |
$$ | |
declare | |
v_process_new bool = (TG_OP = 'INSERT' OR TG_OP = 'UPDATE'); | |
v_process_old bool = (TG_OP = 'UPDATE' OR TG_OP = 'DELETE'); | |
v_event text = TG_ARGV[0]; | |
v_topic_template text = TG_ARGV[1]; | |
v_attribute text = TG_ARGV[2]; | |
v_record record; | |
v_sub text; |
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 or replace function set_timestamps() | |
returns trigger | |
as | |
$$ | |
begin | |
NEW.created_at = ( | |
case | |
when TG_OP = 'INSERT' then | |
NOW() | |
else |
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
console.log(Deno.args); |
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 default function LocalePlugin (builder) { | |
builder.hook('GraphQLObjectType:fields:field', (field, build, ctx) => { | |
const { pgSql: sql, inflection, options } = build | |
const { | |
scope: { pgFieldIntrospection }, | |
addDataGenerator | |
} = ctx | |
if ( |
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 fs from 'fs' | |
export function getLogger (path) { | |
const stream = fs.createWriteStream(path) | |
process.on('beforeExit', () => stream.close()) | |
return msg => { | |
const _ = msg + '' | |
if (!/ select /i.test(_)) { |
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 sh | |
set -e | |
export TEST_SQL="select user || ' connection to ' || (select current_database()) || ' ✅'" | |
### GET CONNECTION DETAILS AND TEST IT | |
echo "First please provide superuser credentials and endpoint" |
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 { omitBy } from "lodash"; | |
import { Plugin } from "postgraphile"; | |
export const RemoveByNodeIdPlugin: Plugin = (builder) => { | |
builder.hook("GraphQLObjectType:fields", (fields, _) => { | |
return omitBy(fields, (_, key) => key.endsWith?.("ByNodeId")); | |
}); | |
}; | |
export default RemoveByNodeIdPlugin; |
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
// RECOMMENDED: Disconnect HEROKU from Github before doing this (though not strictly necessary, I think). | |
//See https://stackoverflow.com/a/61272173/6569950 for more info. | |
// PARAMETERS | |
const TOKEN = ""; // MUST BE `repo_deployments` authorized | |
const REPO = ""; // e.g. "repository" | |
const USER_OR_ORG = ""; // e.g. "your-name" | |
// GLOBAL VARS | |
const URL = `https://api.github.com/repos/${USER_OR_ORG}/${REPO}/deployments`; |
OlderNewer