Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
@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 / 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
/* 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
/*
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
@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.
*
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}({"+65c":function(t,e,n){var r=n("PlFn");"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,inse
@mgussekloo
mgussekloo / webpack.mix.js
Created April 20, 2020 08:56 — forked from viirre/webpack.mix.js
Using different Tailwind config files (eg. one for admin and one for front) for Laravel Mix
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
require('laravel-mix-purgecss');
mix
.js('resources/js/admin/admin.js', 'public/js')
.js('resources/js/front/front.js', 'public/js')
// Admin
.sass(
@mgussekloo
mgussekloo / gist:749e01136b53241ca70bc283e19e880e
Created February 8, 2021 21:25
Preventing PHP from sending mails when using homebrew
Create a file "disablemail.ini" in /opt/homebrew/etc/php/7.4/conf.d
sendmail_path="cat > ~/Sendmail/mail.log"
@mgussekloo
mgussekloo / gist:c0e508b93e32d0dbf8ff2966050766a0
Last active August 12, 2021 11:56
Using Webpack ifdef-loader with Laravel Mix
1. Install ifdef-loader
```bash
yarn add ifdef-loader
```
2. Add the loader to Webpack through Laravel Mix 'webpackConfig' method. Apparently this doesn't overwrite the defaults but merges it nicely.
```js
mix.webpackConfig({
module: {
rules: [
Step 1 - remove current binlogs
mysql -u forge -p -e "RESET MASTER"
Step 2 - create setting to skip binlogs in the future
vi /etc/mysql/conf.d/disable_binlogs.cnf
[mysqld]
skip-log-bin
Step 3 - restart mysql