Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
~/wp-cli.phar core download
~/wp-cli.phar core config --dbname=vuetest --dbuser=homestead --dbpass=secret
~/wp-cli.phar core install --title=Vuetest --url=http://vuetest.dev --admin_user=supervisor --admin_password=secret [email protected]
@mgussekloo
mgussekloo / gist:088288ebf796fa2a3cd83cb7ed77145c
Last active July 27, 2017 14:29
Vue directive, for scrolling to the bottom of an element after updating. Using TweenJS/Tween.js
import Vue from 'vue';
import TWEEN from 'tween.js';
var scrollDownAnimation = false;
var scrollDownFunction = function(el) {
var scrolledToBottom = el.scrollHeight - el.scrollTop === el.clientHeight;
if (scrolledToBottom) return;
if (scrollDownAnimation) {
scrollDownAnimation.stop();
// scroll
var parallaxEmts = $("[data-parallax]");
for (var x=0,max=parallaxEmts.length;x<max;x++) {
var emt = $(parallaxEmts[x]);
emt.data("page-y", emt.offset().top);
};
function parallax() {
if (documentIsHidden()) return;
@mgussekloo
mgussekloo / gist:a21a1128b121c5b58e0262c16ba1d47e
Created September 7, 2017 13:53
NGINX configuration for Symphony CMS
location / {
index index.php;
### main rewrite
try_files $uri $uri/ /index.php?symphony-page=$uri&$args;
}
# Symphony admin redirects
location ~ ^/symphony(/?.*)$ {
{
"Opleiding_SK123ID": "10",
"Brinnummer": "24GE",
"Brinvolgnummer": 2,
"Opleidingscode": 34035,
"OpleidingscodeSamen": 34035,
"NaamOpleiding": "Bedrijfskunde",
"SoortOpleiding": "Bachelor",
"SoortHo": "HBO",
"Bekostiging": "Niet-Bekostigd",
@mgussekloo
mgussekloo / gist:48b2238ae14532114064dbf27a647157
Created November 16, 2017 11:12 — forked from anonymous/gist:f5eb359a7b140fd94da4e111a57c928e
WP Admin pass protect on Laravel Forge
location ~ ^/(wp-admin)/ {
auth_basic "Restricted Access";
auth_basic_user_file /home/forge/domain/.htpasswd;
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
@mgussekloo
mgussekloo / gist:1be25dcd1b3bfc5e59cc7488d4a26575
Created November 16, 2017 11:14
Nginx config to map single page in Wordpress onto its own domain
rewrite ^([^.]*[^/])$ $1/ permanent;
location ~* \.(css|js|eot|ttf|ttc|otf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
location /mathematics/ {
try_files $uri $uri/ /index.php?$query_string;
}
@mgussekloo
mgussekloo / gist:38d10ea75a47df83763c1aa39258d830
Created November 28, 2017 10:42
My config for Laravel Mix with PurgeCSS.
let mix = require('laravel-mix');
let glob = require('glob-all');
let PurgecssPlugin = require('purgecss-webpack-plugin');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
@mgussekloo
mgussekloo / gist:79d927e1f011e26052114a5df8723ab9
Created December 5, 2017 09:26
Draw smooth dashed sine wave with vanilla js and canvas drawing, for trail-like UI element
// $('.js-trail-canvas').drawTrail()
var checkTrails = function() {
$('.js-trail').remove();
ImagesLoaded(document.querySelector('.with-trail'), function() {
$('.js-trail-container').each(function() {
var $container = $(this);
@mgussekloo
mgussekloo / .eslintrc.json
Last active January 9, 2018 15:31
My global ES Lint configuration
{
"env": {
"browser": true,
"es6": true,
"node": true,
"jquery": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"