Skip to content

Instantly share code, notes, and snippets.

View mvaneijgen's full-sized avatar

Mitchel van Eijgen mvaneijgen

View GitHub Profile
@mvaneijgen
mvaneijgen / ACF toggle btn flexible functions.php
Last active April 16, 2021 13:03
Add toggle button to ACF flexible fields
function acf_toggle_flex()
{
?>
<script type="text/javascript">
(function($) {
acf.add_action('load', function($el) {
let $field = $el.find('.acf-field-flexible-content'); // Get flexabile fields
$field = Array.prototype.slice.call($field); // Convert to array
{"lastUpload":"2021-06-14T13:02:41.084Z","extensionVersion":"v3.4.3"}
studioalloy.nl. 500 IN SOA ns1.webhostingserver.nl. hostmaster (2020110500 500 400 1209600 100)
studioalloy.nl. 500 IN NS ns1.webhostingserver.nl.
studioalloy.nl. 500 IN NS ns2.webhostingserver.nl.
studioalloy.nl. 500 IN NS ns3.webhostingserver.nl.
studioalloy.nl. 500 IN A 195.211.74.22
studioalloy.nl. 500 IN MX 10 aspmx.l.google.com.
studioalloy.nl. 500 IN MX 20 alt1.aspmx.l.google.com.
studioalloy.nl. 500 IN MX 20 alt2.aspmx.l.google.com.
studioalloy.nl. 500 IN MX 30 alt3.aspmx.l.google.com.
studioalloy.nl. 500 IN MX 30 alt4.aspmx.l.google.com.
[Error] Origin https://codepen.io is not allowed by Access-Control-Allow-Origin.
[Error] XMLHttpRequest cannot load https://m49mlual6a.execute-api.us-west-2.amazonaws.com/production/zip?token=eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InBhaWQiOmZhbHNlLCJ0ZWFtX2hhc2hpZCI6IllkRXpHbiIsInRlYW1faWQiOjAsInVzZXJfaGFzaGlkIjoiTUFRQkJNIiwidXNlcl9pZCI6Ik1BUUJCTSIsInVzZXJuYW1lIjoibXZhbmVpamdlbiJ9LCJleHAiOjE2MDQ2NTM0OTR9.QgIdOc2AWHFKZJ185Luu2rYwgRYQl0FEtjT1FLPpXAc due to access control checks.
[Error] Failed to load resource: Origin https://codepen.io is not allowed by Access-Control-Allow-Origin. (zip, line 0)
@mvaneijgen
mvaneijgen / function.php
Last active August 18, 2020 06:26
Possible solution for multiple where: in GraphQL and Wordpress
<?php
// Register extra types
add_action('graphql_register_types', function () {
$customposttype_graphql_single_name = “MyCustomPostType”;
register_graphql_field('RootQueryTo' . $customposttype_graphql_single_name . 'ConnectionWhereArgs', 'postObjectIdTWO', [
'type' => 'ID',
'description' => __('The ID of the post object to filter by', 'your-textdomain'),
]);
(function ($) {
// External tools and plugis JS
gsap.registerPlugin(ScrollTrigger); // Register plugin so you can use defauls
gsap.registerPlugin(MotionPathPlugin);
ScrollTrigger.defaults({ // Defaults are used by all ScrollTriggers
toggleActions: "restart pause reverse pause", // Scoll effect Forward, Leave, Back, Back Leave
markers: true // Easaly remove markers for production
});
<?php
$taxonamy = 'location';
$terms = get_terms($taxonamy, array('hide_empty' => true));
?>
<?php if (!empty($terms) && !is_wp_error($terms)) : ?>
<?php foreach ($terms as $term) : ?>
<?php
$args = array(
'post_type' => 'thanks',
'posts_per_page' => -1,
{
"key": "group_58f9b55cdbf02",
"title": "Flex",
"fields": [
{
"key": "field_58f9b56154b9a",
"label": "Contentblokken",
"name": "content-blocks",
"type": "flexible_content",
"instructions": "",
@mvaneijgen
mvaneijgen / colorSorting.js
Created April 25, 2020 14:33 — forked from afonsograca/colorSorting.js
Color sorting in JavaScript
//Sorting Hex Color:
var scheme = [
"#4C4C4C","#1F2029","#35404E","#282938","#00A0BE","#C67C48","#32CF72", "#4155D1","#B86838","#D81196","#149C92","#786DC4","#DB2C38","#83C057", "#A4A4A4","#55747C","#FFFFFF"
];
var Color = function Color(hexVal) { //define a Color class for the color objects
this.hex = hexVal;
};
000
001
002
003
004
005
006
007
008
009