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
<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" />
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 {
<?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
async function findOrCreateUser(user, field, value) {
const user = await User.where({
[field]: value
}).fetch()
if (user) return user
}
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
# 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()
# 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()
const path = require('path')
const { readFile, writeFile } = require('fs').promises
const glob = require('fast-glob')
const mjml2html = require('mjml')
const outputExtension = 'hbs'
async function start () {
// Todo: clear emails before
const templates = await glob('./src/emails/**/*.mjml')
try {
const compiledTemplates = await Promise.all(
Child
<template>
<no-ssr>
<vuetable
ref="vuetable"
:api-url="apiURL"
:slots="$slots"
v-bind="tableOptions"
v-on="$listeners" />
<!-- here i want to use the slots from the other components -->
import Echo from 'laravel-echo'
import Vue from 'vue'
window.io = require('socket.io-client')
const host = process.env.WEBSOCKET
/**
* In Components you can now write
* socket: {
channels: [
{
'nice-public': {