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
docker run --rm -ti -p 8681:8681 -e PUBSUB_PROJECT1=dev,Inhabitant:InhabitantSubscription,User:UserSubscription,Group:GroupSubscription,Role:RoleSubscription,Passion:PassionSubscription,InsertPoints:InsertPointsSubscription,InhabitantVoucher:InhabitantVoucherSubscription messagebird/gcloud-pubsub-emulator:latest | |
## PUBSUB_PROJECT1=(Project Id),(List of "Topic:Subscription"), <docker-image> | |
PUBSUB_EMULATOR_HOST=localhost:8681 ./myapp | |
PUBSUB_PRIVATE_KEY=undefined | |
PUBSUB_CLIENT_EMAIL=undefined | |
PUBSUB_PROJECT_ID=dev | |
PUBSUB_TYPE=service_account |
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
import axios from 'axios' | |
import { OrderformResponse } from './types' | |
/** | |
* It takes a URL, parses the URL for UTMs, and then attaches the UTMs to the order form | |
* @param {string} url - The URL that you want to parse the UTM tags from. | |
*/ | |
export async function parseUTMTagsFromURL(url: string) { | |
const parsedUrl = new URLSearchParams(new URL(url).search) |
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
export function generateStylesheetBasedOnClasses( | |
classes: string[], | |
props: Record<string, string> | |
) { | |
let stylesheetString = `` | |
classes.forEach((token) => { | |
if (!props[token]) return | |
stylesheetString += `.${token} { |
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
// IS Operator | |
type Breed = "A" | "B" | "C" | |
interface Cat { | |
meow: () => void | |
breed: Breed | |
} | |
function isCat(cat: Cat): cat is Cat { |
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 oldXHROpen = window.XMLHttpRequest.prototype.open | |
window.XMLHttpRequest.prototype.open = function (method, url, async) { | |
console.log(method, url, async) | |
this.addEventListener('load', function () { | |
console.log('load: ' + JSON.stringfy(this)) | |
// This as callback function for listener | |
}) |
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
FROM node:alpine | |
WORKDIR /usr/app | |
COPY ./package*.json ./ | |
RUN apk add g++ make jq py3-configobj py3-pip py3-setuptools python3 python3-dev curl \ | |
&& pip3 install pathlib matplotlib pandas \ | |
&& npm install \ | |
&& rm -rf /var/cache/apk/* |
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
FROM node:alpine | |
WORKDIR /usr/app | |
COPY ./package*.json ./ | |
RUN apk add g++ make py3-configobj py3-pip py3-setuptools python3 python3-dev curl \ | |
&& npm install \ | |
&& rm -rf /var/cache/apk/* |
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
grep -o '"fx_rate":[[:digit:]]....' | head -1 | { read -r wumessage; echo $wumessage } |
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
#!/bin/bash | |
echo "You died!" | |
echo "Hey do you like coffee? (y/n)" | |
read coffee_preference | |
case $coffee_preference in | |
"y") |
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
#!/bin/bash | |
#chmod u+x "this" | |
echo "What is your name?" | |
read name | |
echo "What is your age?" | |
read age | |
if [ $age -gt 18 ] |
NewerOlder