Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
@mgussekloo
mgussekloo / class-gfml-conditional-logic.php
Created October 31, 2019 12:46
Fix a bug with WPML Gravity Forms Multilingual & Gravity Forms Chained Selects
<?php
/**
* @author OnTheGo Systems
*/
class GFML_Conditional_Logic extends GFML_Form {
/**
* It translates the attributes of the conditional logic, before translating the fields.
* This is necessary, or it would not be possible to adjust the conditional logic based on values from "choices" fields.
*
/*
Tailwind - The Utility-First CSS Framework
A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink),
David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger).
Welcome to the Tailwind config file. This is where you can customize
Tailwind specifically for your project. Don't be intimidated by the
length of this file. It's really just a big JavaScript object and
/* Gravity forms merge tags on multi page form
There seems to be a bug in Gravity Forms, when you're using custom Merge Tags;
normally, an empty input value will be replaced by the
"default value", if you use the Default Value option in Gravity Forms.
On multipage forms this means that fields that were left empty _intentionally_ on page one will
be overwritten by the default value as soon as you load page two (and so on).
This is a fix I came up with.
Replace "CustomMergeTagName" with (part of) your custom Merge Tag, or leave those lines out entirely
@mgussekloo
mgussekloo / after.sh
Created April 25, 2018 09:29 — forked from berkayunal/after.sh
Laravel Homestead after.sh placed in ~/.homestead/after.sh
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
echo "Updating machine software"
locale-gen en_GB.UTF-8
# Updating composer
@mgussekloo
mgussekloo / gist:54802a17b7788e851196b492a6db4d59
Created March 13, 2018 18:44
Proposal for dynamic operations for Timber
/**
* Dynamic operations
*/
// All the valid operations
static $registered_operations;
// Convenience method to get the valid operations.
// To register a valid operation, use the filter "timber/image/operations".
public static function getOperations() {
@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"
@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 / 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;
}