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
module.exports = { | |
client: { | |
service: { | |
name: 'Shopify', | |
url: 'https://{YOUR_STORE}.myshopify.com/api/unstable/graphql.json', | |
headers: { | |
'x-shopify-storefront-access-token': '{YOUR_PUBLIC_STOREFRONT_ACCESS_TOKEN}', | |
'Content-Type': 'application/graphql', | |
}, | |
}, |
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
services: | |
node-server: | |
build: . | |
ports: | |
- "3000:3000" | |
links: | |
- cassandra | |
depends_on: | |
cassandra: | |
condition: service_healthy |
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
# Get Wifi SSID | |
function get-ssid { | |
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | awk -F: '/ SSID/{print $2}' | |
} | |
# Get wifi password for current SSID | |
function wifi-password { | |
security find-generic-password -wa $(get-ssid) | |
} |
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
function debounce<T>(fn: (...args: any[]) => Promise<T>, ms: number = 300) { | |
let timer: number | undefined | |
return (...args: any[]): Promise<T> => { | |
clearTimeout(timer) | |
return new Promise((resolve, reject) => { | |
timer = window.setTimeout( | |
() => | |
fn(...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 interface RetryConfig { | |
timeout: number | |
max: number | |
} | |
export const retryAction = ( | |
fn: (...args: any[]) => Promise<any>, | |
{ timeout, max }: RetryConfig | |
): Promise<any | void> => { | |
// Keep a count of the retries |
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 handleClickOutside = (Component, useCapture = true) => { | |
return class extends React.Component { | |
// Create a reference to the component instance | |
instance = React.createRef() | |
// Create a reference to the component DOM element (forwardedRef) | |
node = React.createRef() | |
componentDidMount() { | |
document.addEventListener('click', this.handleClick, useCapture) |
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
module.exports = { | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
project: './tsconfig.json', | |
}, | |
extends: [ | |
'plugin:@typescript-eslint/eslint-recommended', | |
'plugin:@typescript-eslint/recommended', | |
'prettier', | |
'prettier/@typescript-eslint', |
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 enum Events { | |
LOGIN = 'login', | |
LOGOUT = 'logout' | |
} | |
interface LoginPayload { | |
login: true | |
} | |
interface LogoutPayload { |
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
Show hidden characters
{ | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "es5", | |
"module": "commonjs", | |
"lib": ["es2015"], | |
/* Strict Type-Checking Options */ | |
"strict": true, | |
"typeRoots": [ |
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
version: '3' | |
services: | |
grafana: | |
image: "grafana/grafana" | |
ports: | |
- "3000:3000" | |
prometheus: | |
image: "prom/prometheus" | |
ports: | |
- "9090:9090" |
NewerOlder