Skip to content

Instantly share code, notes, and snippets.

View wajeht's full-sized avatar
🚀
busy shipping software!

Jaw wajeht

🚀
busy shipping software!
View GitHub Profile

Official VueJS libraries, e.g. vue-router, are simultaneously dependencies and dependents of vue, seemingly making those impossible to use with ESM CDN import statements without using <script type="importmap">, which isn't supported everywhere.

VueJS standalone boilerplates

Basic, working

Full code snippet :

// import cp from 'child_process';
async function main() {
try {
const basedUrl = '';
const username = '';
const password = '';
const loginResponse = await fetch(`${basedUrl}/api/v2/auth/login`, {
method: 'POST',
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
if (process.argv.length <= 4) {
console.log('Usage: node index.js <input_directory> <source_file_extension> <output_directory> <output_file_extension>');
process.exit(1);
}
async function main() {
const headers = {
'Content-Type': 'application/json',
'X-Auth-Key': 'test',
'X-Auth-Email': 'test',
};
const zone = "google.com";
try {
@wajeht
wajeht / cloudflare-ddns-update.sh
Created October 29, 2023 23:46 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@wajeht
wajeht / generate-nginx-cloudflare-allow.sh
Created October 27, 2023 21:44 — forked from mkg20001/generate-nginx-cloudflare-allow.sh
A script to generate a config to allow or additionally allow cloudflare addresses for a specific domain
#!/bin/bash
set -e
cf_ips() {
echo "# https://www.cloudflare.com/ips"
for type in v4 v6; do
echo "# IP$type"
curl -sL "https://www.cloudflare.com/ips-$type/" | sed "s|^|allow |g" | sed "s|\$|;|g"
@wajeht
wajeht / inertia.js
Created January 21, 2023 01:06 — forked from crgeary/inertia.js
Inertia adapter for Express
const lodashPick = (object, keys) => {
return keys.reduce((obj, key) => {
if (object && object.hasOwnProperty(key)) {
obj[key] = object[key];
}
return obj;
}, {});
};
const setupProps = async (props) => {
@wajeht
wajeht / generate_images.sh
Created October 5, 2022 18:54 — forked from acorn1010/generate_images.sh
Foony Generate Images Script (credit keraion)
#!/usr/bin/env bash
# Credit to keraion for huge readability improvements and parallelization.
set -e
# Creates webp / avif images for images that don't already exist and places them in the public folder
# This script can take a while to run
# Install deps
# sudo apt-get install -f webp ffmpeg