Import PropType from @vue/runtime-core and NOT @nuxtjs/composition-api
The legacy composition-api library is outdated and no longer maintained.
import type { PropType } from '@vue/runtime-core'
import fs from 'fs' | |
import path from 'path' | |
// Requires folder structure | |
// config | |
// -> netlify | |
// Run with NETLIFY_CONFIG_FILE=netlify.develop.toml node scripts/copy-netlify-config-to-root.mjs | |
// ^^ You get the picture |
const fs = require('fs') | |
// Grabbed from here: https://gist.github.com/Ugrend/09890dbc7a049651d470d1f8b6b73e1a | |
function randomMedicareNumber(): string { | |
let sum = Math.floor(Math.random() * 5) + 2 | |
const weights = [1, 3, 7, 9, 1, 3, 7, 9] | |
const num = [sum] | |
for (let i = 0; i < 7; i++) { | |
const n = Math.floor(Math.random() * 10) | |
sum += n * weights[i + 1] |
const validateUrl = /(https?\:\/\/([\w\-]+)?.?pointhacks.com(.au)?)/gi | |
// In use | |
validateUrl.test('https://broken.com') | |
validateUrl.test('https://working.pointhacks.com.au') |
/** | |
* Liteweight matchMedia | |
* | |
* @param {String} query - The media query. | |
* @param {Function} - onChange callback. | |
*/ | |
const useMatchMedia = (query, onChange = matches => matches) => { | |
const mm = matchMedia(query) | |
// Safari still uses addListener | |
mm.addListener(mql => onChange(mql.matches)) |
/* | |
* author: @gkweb | |
* Add this as an inline style tag to the <head> | |
* | |
* Adjust for whatever media query structure you have | |
* Helps with CLS - The style is there immediately and this means you can set dimensions for every screensize | |
*/ | |
@media screen and (min-width: 480px) { | |
[data-sm-width] { |
// WARNING USE WITH CAUTION! This will delete any user in the search result!!! - You have been warned! | |
// Quicker than setting up the Management API with all its related tooling | |
// Step 1 - Search for the users you want to delete in /dashboard/COUNTRYCODE/TENANT/users | |
// Step 2 - Open the browser console and paste the following. Be sure to read the warning at the top of the file. | |
Array.prototype.slice.call(document.querySelectorAll('table[data-cosmos-key=table] > tbody > tr')).forEach(e => { | |
setTimeout(() => { | |
console.log('Deleting...') |
// computed: | |
// Dynamic input ID - Useful for inputs / label pairs where there is no requirement to specify the ID | |
inputId() { | |
return Math.random().toString(36).substr(2, 5) | |
} | |
// Detect if slots available programmatically (no need for prop toggles!) | |
hasSlot() { | |
return this.$scopedSlots && typeof this.$scopedSlots.slotName === 'function' | |
} |
// DEMO: https://codepen.io/gkweb/pen/QWEeBeV | |
.todo { | |
opacity: 0.25; | |
padding: 2rem 1rem; | |
margin-bottom: 1rem; | |
background: repeating-linear-gradient( | |
-45deg, | |
transparent, | |
transparent 5px, |
I hereby claim:
To claim this, I am signing this object: