Skip to content

Instantly share code, notes, and snippets.

View davidroyer's full-sized avatar

David Royer davidroyer

View GitHub Profile
<template>
<div>
<label class="font-semibold block text-gray-700" for="input"
>Base Input</label
>
<input
type="text"
:value="modelValue"
@input="$emit('update:modelValue', $event.target.value)"
/>
@davidroyer
davidroyer / download-videos-script.js
Created September 3, 2021 17:39
Starting point for downlaod dev video lessons
function goToNextLesson () {
const nextLesson = document.querySelector('.list-item.unlock.active ~ .list-item.unlock')
if (nextLesson) nextLesson.click()
}
function handleDownload() {
let downloadLink = document.querySelector('.lesson-aside a.button')
downloadLink.click()
@davidroyer
davidroyer / tailwind.config.js
Created August 28, 2021 04:10
Tailwind Overwrite Select Icon
const plugin = require('tailwindcss/plugin')
const svgToDataUri = require('mini-svg-data-uri')
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {}
},
variants: {
@davidroyer
davidroyer / settings.json
Last active July 11, 2021 00:30
Fix for CSS and using @apply for Tailwind
"css.lint.unknownAtRules": "ignore"
@davidroyer
davidroyer / jsconfig.json
Created July 10, 2021 15:55
Working Example
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
}
},
"exclude": ["node_modules", "dist"]
}
git branch -m new-branch-name
git push origin --delete refactor-some-feature
@davidroyer
davidroyer / export-extensions.sh
Last active March 14, 2021 05:47
Export & Import VSCode Extensions
code --list-extensions > extensions.list
function titleCaseText(text) {
const words = text.split('-')
return words
.map(word => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase())
.join(' ')
}
@davidroyer
davidroyer / delay.js
Created February 4, 2021 07:43
Delay function using setTimeout with Promises
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))