Skip to content

Instantly share code, notes, and snippets.

View cannap's full-sized avatar
💥
Working from home

Marko Bolliger cannap

💥
Working from home
View GitHub Profile
# Automate npm updating when using nvm-windows
# Installs npm@latest for the current active node install
# Source: https://github.com/coreybutler/nvm-windows/issues/300#issuecomment-368192283
$ErrorActionPreference = "Stop"
# Create a folder in the Temp directory and return it
# Source: https://stackoverflow.com/a/34559554/9165387
function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
$name = [System.IO.Path]::GetRandomFileName()
async register () {
try {
const user = await this.$store.dispatch('auth/register', this.form)
console.log('User registered', user)
} catch (error) {
console.log('Fail in local component', error)
}
},
async lo
async function findOrCreateUser(user, field, value) {
const user = await User.where({
[field]: value
}).fetch()
if (user) return user
}
<?php
/**
* Cart Page
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
const routify = (() => {
let openVnode
let links
function eventHandler(e) {
e.preventDefault()
const target = e.target.attributes[0].value
openVnode.context.$router.push({ path: target })
}
return {
<template>
<div id="content">
<page-header
v-if="page.acf.header.title"
:title="page.acf.header.title"
:alt="page.acf.header.alt || false"
:content="page.acf.header.introduction" />
<?php /* Template Name: Blog Template */ ?>
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>
<?php /* Template Name: Blog Template */ ?>
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>
some html
.page-leave-active {
animation: blurOut 0.3s ease-in both;
overflow-y: hidden !important;
}
.page-enter-active {
animation: blurIn 0.3s ease-in both;
}
import firebase from './index'
const db = firebase.firestore()
export default db