This file contains hidden or 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
/** | |
* Snippet from https://gist.github.com/Convly/6cf1e6d143bb0a90c8de2242fdedda8e | |
* Ref: https://docs.strapi.io/dev-docs/typescript/development#generate-typings-for-content-types-schemas | |
*/ | |
import type { Schema, Utils, UID } from "@strapi/types"; | |
import type { Schema, Utils, UID } from '@strapi/types'; | |
// https://github.com/microsoft/TypeScript/issues/50122 |
This file contains hidden or 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
# https://developer.hashicorp.com/consul/api-docs/catalog#list-datacenters | |
# https://developer.hashicorp.com/consul/api-docs/health#list-service-instances-for-service | |
# requires jq: https://jqlang.github.io/jq/ | |
SERVICE= | |
CONSUL_HOST= | |
for DC in `curl -s "https://$CONSUL_HOST/v1/catalog/datacenters" | jq '.[]' | sed -e 's/"//g'`; do curl -s "https://$CONSUL_HOST/v1/health/service/$SERVICE?dc=$DC" | jq '.[] | "\(.Node.Node) \(.Service.ID)"' | sed -e 's/"//g'; done |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Connect> | |
<AIAssistant id="assistant-uuid"> | |
<Greeting>Hi how can I help you today?</Greeting> | |
<Voice provider="telnyx"> | |
<Telnyx voice_id="0" model_id="LibriTTS" phonemizer="gruut" voice_speed="1.333" diffusion_steps="5"/> | |
</Voice> | |
</AIAssistant> | |
</Connect> |
This file contains hidden or 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 [ -f .env ]; then | |
export $(cat .env | xargs) | |
export CMS_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
echo "✅ Loaded envs" | |
else | |
echo ".env file Not Found" | |
fi |
This file contains hidden or 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
// | |
/** | |
* On browser load | |
* if using https://github.com/vasturiano/globe.gl#globe-layer | |
* call inside `animate()` function or `onGlobeReady`, or a react wrapper `onLoad` callback | |
*/ | |
// after globe is loaded and animation started | |
const canvasElement = document.querySelector( | |
`canvas#canvas-id` |
This file contains hidden or 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
# transform all files to .md, including nested. Use -n to preview changes | |
rename -p -e 's/(\/.*)\.php/$1\.md/' **/*.php | |
rename -p -e 's/(\/.*)\.py/$1\.md/' **/*.py | |
rename -p -e 's/(\/.*)\.rb/$1\.md/' **/*.rb | |
rename -p -e 's/(\/.*)\.java/$1\.md/' **/*.java | |
rename -p -e 's/(\/.*)\.cs/$1\.md/' **/*.cs | |
# It outputs something like "'php/outbound_voice_profiles/outbound_voice_profiles/get.php' would be renamed to 'php/outbound_voice_profiles/outbound_voice_profiles/get.md'" |
This file contains hidden or 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
// check all pricing pages built locally at the same time to stress test rate limiting | |
// run this script with node >= 18.x | |
Promise.allSettled( | |
[ | |
"http://127.0.0.1:3000/pricing/elastic-sip/al", | |
"http://127.0.0.1:3000/pricing/elastic-sip/am", | |
"http://127.0.0.1:3000/pricing/elastic-sip/ao", | |
"http://127.0.0.1:3000/pricing/elastic-sip/ar", | |
"http://127.0.0.1:3000/pricing/elastic-sip/at", | |
"http://127.0.0.1:3000/pricing/elastic-sip/au", |
This file contains hidden or 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
# set git global config to always sign commits | |
$ git config --global gpg.program gpg | |
$ git config --global commit.gpgsign true | |
# pinentry to read gpg passphrase from git user.signingKey | |
$ brew install pinentry-mac | |
# set pinentry-mac as the default program | |
$ echo "pinentry-program $(which pinentry-mac)" > ~/.gnupg/gpg-agent.conf |
This file contains hidden or 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 http = require('http'); | |
const fs = require('fs'); | |
const requestListener = function (req, res) { | |
req.on('error', (err) => { | |
console.error(err); | |
res.statusCode = 400; | |
res.end('400: Bad Request'); | |
return; | |
}); |
This file contains hidden or 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 contentful = require('contentful-management'); | |
const REFERENCE_FIELD = 'topic_ref'; | |
const SHORT_TEXT_FIELD = 'topic'; | |
const client = contentful.createClient({ | |
accessToken: process.env.CONTENTFUL_MANAGEMENT_TOKEN, | |
}); | |
client |
NewerOlder