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
import { Directive, DirectiveBinding, VNode } from 'vue-demi' | |
export const directive = (): Directive<HTMLElement | SVGElement> => { | |
const register = ( | |
el: HTMLElement | SVGElement, | |
binding: DirectiveBinding, | |
node: VNode< | |
any, | |
HTMLElement | SVGElement, | |
{ |
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
<template> | |
<button @click="playButton" /> | |
</template> | |
<script> | |
// NPM | |
import useSound from 'vue-use-sound' | |
// Assets | |
import buttonSfx from '@/assets/sounds/pop-down.mp3' |
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
import React, { Dispatch } from 'react' | |
import reducer from './b_reducer' | |
// Typings | |
export interface ContextDefaultState { | |
name: string | null | |
} | |
// Defaults | |
export const contextDefaultState: ContextDefaultState = { |
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
describe('my test suite', () => { | |
afterEach(() => { | |
document.getElementsByTagName('html')[0].innerHTML = ''; | |
}); | |
it('your test here', () => { | |
document.getElementsByTagName('html')[0].innerHTML = 'Your dom manipulation 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
# Taken from Netlify Community answer from Luke (Support Engineer @ Netlify) | |
# URL: https://community.netlify.com/t/trying-to-redirect-from-api-endpoint-to-netlify-functions-servers-endpoint/7609/10 | |
[[redirects]] | |
from = "/api/*" | |
to = "/.netlify/functions/:splat" | |
status = 200 | |
force = true |
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
<template> | |
<transition | |
:css="false" | |
@before-enter="beforeEnter" | |
@enter="enter" | |
@after-enter="afterEnter" | |
@enter-cancelled="enterCancelled" | |
@before-leave="beforeLeave" | |
@leave="leave" | |
@after-leave="afterLeave" |
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
# This is intended to be added inside a sourced file in your shell, such as ~/.bash_profile. | |
# If you want to use the command once, you can copy the text between the quotes inside your terminal. | |
# Disable dock alias | |
alias disable_dock="defaults write com.apple.dock autohide-delay -float 1000; killall Dock" | |
# Enable dock | |
alias enable_dock="defaults delete com.apple.dock autohide-delay; killall Dock" | |
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
import { | |
PerspectiveCamera, | |
DirectionalLight, | |
HemisphereLight, | |
Scene, | |
WebGLRenderer, | |
Color, | |
Clock, | |
} from 'three' | |
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader' |