Skip to content

Instantly share code, notes, and snippets.

Avatar

Dane Lowe danelowe

View GitHub Profile
View lazy-hydration.ts
import { Component, defineAsyncComponent, defineComponent, h } from 'vue'
export function hydrateNever(componentOrFactory: Component): Component {
return makeHydrationBlocker(componentOrFactory, {
beforeCreate() {
this.never = true
},
})
}
@danelowe
danelowe / README.markdown
Last active Mar 25, 2021
Mopidy and librespot (spotify connect)
View README.markdown

Method taken from https://github.com/pimusicbox/pimusicbox

Assuming mopidy and Iris etc are already installed, we need to install mpc, so that we can stop playback on mopidy when we use spotify connect

sudo apt-get install mpc 

Then we install the easiest librespot spotify connect system

@danelowe
danelowe / gist:dab47d7f73cfacf7662f
Last active Apr 22, 2017
Wordpress MU router.php
View gist:dab47d7f73cfacf7662f
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
// Do some URL rewriting
if (preg_match('/\/([_0-9a-zA-Z-]+\/)?(wp-.*)/', $path, $matches)) {
$path = '/' . $matches[2];
if (file_exists($root . $path) && is_file($root . $path) && !strpos($path, ".php")) {
// The rewritten path is to a non-PHP file. It's probably a static asset
@danelowe
danelowe / .gitignore
Created Oct 22, 2013
Magento .gitignore
View .gitignore
/public/app/etc/local.xml
/public/var/
/public/media/
/public/blog
/public/var
/public/media
/public/feeds/
/.idea/
/.idea
/tools/capistrano/log
View development_router.php
<?php
//$_SERVER['MAGE_RUN_CODE'] = 'au';
//$_SERVER['MAGE_RUN_CODE'] = 'us';
$uri = $_SERVER['REQUEST_URI'];
if (strpos($uri, '?') !== false)
list($uri, $params) = explode('?', $uri, 2);
if (file_exists(__DIR__ . '/' . $uri)) {
return false; // serve the requested resource as-is.
} else {
include_once 'index.php';