Skip to content

Instantly share code, notes, and snippets.

View MikeyBeLike's full-sized avatar

Michael Olukoya MikeyBeLike

View GitHub Profile
@MikeyBeLike
MikeyBeLike / fetch-pokemon.mjs
Last active August 2, 2023 07:29
Normalise Pokemon API Data
import {
promises as fs
} from 'fs'
import fetch from 'node-fetch'
const POKEMON_API_BASE_URL = 'https://pokeapi.co/api/v2'
function extractPokemonIdFromUrl(url) {
return new URL(url).pathname.split('/').at(-2) ?? ''
}
@MikeyBeLike
MikeyBeLike / ExampleCustomInput.vue
Created March 17, 2021 00:23
Intl-tel-input for Vue 3 using composition API and custom input
<template>
<div class="custom-input">
<label class="custom-input__label" :for="`input-${id}`">
<slot>Input</slot>
</label>
<div class="mt-1">
<input
:id="`custom-input-${id}`"
:type="type"
:required="required"
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");