Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
{
"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 --admin_email=me@domain.com
@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
$(function(){
var documentHeight,
windowHeight,
creativeShipping,
creativeShippingBottom;
// Do not use $(document).height();, chrome returns wrong value
//documentHeight = $(document).height();
@mgussekloo
mgussekloo / gist:9077f382beac43cfe622
Last active August 29, 2015 14:04
Using simple bash script to compile js and css (without Grunt)
#!/bin/bash
Curpath="`pwd`"
WatchEnabled=false
SassEnabled=false
JsEnabled=false
VersionEnabled=false
while [ $# -gt 0 ]
do
<h4(.*?)>|</h4>|<h2(.*?)>|</h2>|<h3>|</h3>|<p(.*?)>|</p>|<span(.*?)>|</span>|_{2,}|&nbsp;|class="(.*?)"|height="(.*?)"|width="(.*?)"|alt=""|target="(.*?)"|style="(.*?")|<div(.*?)>|</div>|<table(.*?)>|</table>|<tr>|</tr>|<td(.*?)>|</td(.*?)>|<tbody>|</tbody>|http://www\.cmhf\.nl