I was looking for a SSR and scoped styles ready solution to implement inline SVG with Nuxt
You need svg-inline-loader
and xmldom
to be installed.
<ifModule mod_rewrite.c> | |
Options +FollowSymLinks | |
IndexIgnore */* | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule (.*) index.html | |
</ifModule> |
module.exports = { | |
build: { | |
// Remove hash from build files | |
filenames: { | |
css: 'common.css', | |
manifest: 'manifest.js', | |
vendor: 'common.js', | |
app: 'app.js', | |
chunk: '[name].js' |
I was looking for a SSR and scoped styles ready solution to implement inline SVG with Nuxt
You need svg-inline-loader
and xmldom
to be installed.
router.beforeEach((to, from, next) => { | |
const requiresAuth = to.matched.some(record => { | |
return record.meta.requiresAuth | |
}) | |
if (requiresAuth && !store.$data.isRegistered) { | |
next('/login') | |
} else { | |
next() | |
} | |
}) |
var cushion = .5; | |
var length = 50; | |
var dx = point.x - mouse.x; | |
var dy = point.y - mouse.y; | |
var da = Math.sqrt(dx * dx + dy * dy); | |
// Tend à ramener la distance entre les segments à length | |
var ox = dx / da * length - dx; | |
var oy = dy / da * length - dy; |
<?php | |
// Acme\DemoBundle\Twig\GravatarExtension | |
namespace Acme\DemoBundle\Twig; | |
class GravatarExtension extends \Twig_Extension | |
{ | |
private $secure_request = false; |
function check (DELAY_MINUTE = 1, RESPONSE_CODE = 200) { | |
var req = new XMLHttpRequest() | |
req.addEventListener('load', onLoad) | |
function open () { | |
req.open('HEAD', location.href, true) | |
req.send() | |
} | |
function onLoad () { | |
req.status === RESPONSE_CODE ? notify() : setTimeout(open, DELAY_MINUTE * 60 * 1000) | |
} |
import SubfolderComponents from './subfolder' | |
export default { | |
components: { | |
// This will add all components in subfolder | |
...SubfolderComponents | |
} | |
} |
module.exports = (string) => { | |
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() | |
} |
This was a very straightforward workaround I used in a project to get things done while the assemble team is working on some serious converter gulp-convert.