cb:()=> Promise<void> = () => Promise.resolve();
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/expect | |
set timeout -1 | |
spawn npm init -y playwright@latest | |
expect "TypeScript" { send "\r" } | |
expect "tests" { send "\r" } | |
expect "Add a GitHub Actions workflow" { send "n\r" } | |
expect "Install Playwright browsers" { send "y\r" } |
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 validateABN(abn: string): boolean { | |
/* | |
@name: validateABN | |
@param {string} abn | |
@returns {boolean} | |
@link https://abr.business.gov.au/Help/AbnFormat | |
*/ | |
const weightingFactors = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19] | |
const cleanedABN = abn.replace(/\s/g, '') |
- Follow material-ui migration v4 to v5. May require manual upgrade with legacy refactor in future.
- As part of the package:
"@emotion/react": "^11.xxx",
"@emotion/styled": "^11.xxx",
"@mui/icons-material": "^5.0.1",
"@mui/lab": "^5.0.0-alpha.49",
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 getTranslationMap(rhyme) { | |
const rhymes = { | |
"apples and pears": "Stairs", | |
"hampstead heath": "Teeth", | |
"loaf of bread": "Head", | |
"pork pies": "Lies", | |
"whistle and flute": "Suit", | |
}; | |
return rhymes[rhyme.toLowerCase()] ?? "Rhyme not found"; |
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
// OAuth handles the nounce and tokens for you under the hood, but seems like OAuth is nolonger being maintained. | |
// Works as of 31 Dec 2018, unless I added a typo while obfusicating secrets... think not. | |
const OAuth = require('oauth').OAuth; | |
const oauth = new OAuth( | |
'https://api.twitter.com/oauth/request_token', | |
'https://api.twitter.com/oauth/access_token', | |
'your application consumer key', | |
'your application secret', | |
'1.0A', |
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
var http = require('http'), | |
sys = require('sys'), | |
URL = require('url'), | |
querystring = require('querystring'), | |
OAuth = require('oauth').OAuth; | |
var oa = new OAuth('https://api.twitter.com/oauth/request_token', | |
'https://api.twitter.com/oauth/access_token', | |
'YOUR APP CONSUMER KEY HERE', | |
'YOUR APP CONSUMER SECRET HERE', |
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 http = require("https"); | |
// prettier-ignore | |
const options = { | |
"method": "GET", | |
"hostname": "api.twitter.com", | |
"port": 443, | |
"path": "/1.1/collections/entries.json?id=custom-90708098097098-fake", | |
"headers": { | |
"authorization":`OAuth oauth_consumer_key="yourtwitterconsumerkey",oauth_token="yourregisteredtwittertoken", oauth_signature_method="HMAC-SHA1",oauth_timestamp="atimestame",oauth_nonce="anonceofyourchoic",oauth_version="1.0",oauth_signature="anoauthtweet"`, | |
"cache-control": "no-cache" |
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 analyticsIFFE(){ | |
const googleTagObj = { hostname :'yourDomainName', gtag: 'UA-XXXXXX-2'}; | |
if (document.location.hostname === googleTagObj.hostname){ | |
const documentHead = document.head; | |
const scriptTag = document.createElement("script"); | |
scriptTag.async = 1; | |
scriptTag.src = `https://www.googletagmanager.com/gtag/js?id=${googleTagObj.gtag}` | |
documentHead.appendChild(scriptTag); | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} |
NewerOlder