Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
@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: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: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;
}
{
"Opleiding_SK123ID": "10",
"Brinnummer": "24GE",
"Brinvolgnummer": 2,
"Opleidingscode": 34035,
"OpleidingscodeSamen": 34035,
"NaamOpleiding": "Bedrijfskunde",
"SoortOpleiding": "Bachelor",
"SoortHo": "HBO",
"Bekostiging": "Niet-Bekostigd",
@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(/?.*)$ {
// 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: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();
~/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:7eb4233d15063a8e27ad
Created November 17, 2015 08:32
Updating EXIF timestamps of photos and avi's, for use with Dropbox Carousel timeline
This should be a part of the Carousel app, but whatever. You'll need ExifTool and FFMPEG.
exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile -overwrite_original .
exiftool -if 'not $datetimeoriginal' '-DateTimeOriginal=1980:01:01 00:00:00' -overwrite_original .
ffmpeg -i "input.avi" -metadata "ICRD=1980:01:01 00:00:00" -codec copy "output.avi"
@mgussekloo
mgussekloo / gist:8ec5fa53c1505d032991
Last active January 26, 2018 00:09
Timberdate-filter for Twig, to use in combination with Wordpress & Timber
Add to something like functions.php
// https://www.skyverge.com/blog/down-the-rabbit-hole-wordpress-and-timezones/
function wp_get_timezone_string() {
// if site timezone string exists, return it
if ( $timezone = get_option( 'timezone_string' ) )
return $timezone;
// get UTC offset, if it isn't set then return UTC