Skip to content

Instantly share code, notes, and snippets.

View mvaneijgen's full-sized avatar

Mitchel van Eijgen mvaneijgen

View GitHub Profile
@mvaneijgen
mvaneijgen / input volume.applescript
Created February 18, 2020 14:13
MacOS AppleScript toggle microphone input volume from 0 to 100
if input volume of (get volume settings) is 0 then
set volume input volume 100
else
set volume input volume 0
end if
@mvaneijgen
mvaneijgen / material-theme.terminal
Created June 15, 2015 20:27
material-theme.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw
NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAoMC4wMzkzODA3NDc4MiAwLjE2
@mvaneijgen
mvaneijgen / Scale resolution.scpt
Last active March 26, 2023 10:46
Change screen resolution AppleScript
local index1, index2
set index1 to 3 -- 1920 x 1200
set index2 to 4 -- 1280 x 800
-- Launch "System Preferences", open the "Displays" options and change to the "Display" tab
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
@mvaneijgen
mvaneijgen / functions.php
Last active September 20, 2022 05:29
Fixing bbPress 2.6 threaded (nested) replies & paging (original code [wpup.co](https://wpup.co/bbpress-threaded-nested-replies-with-paging/)) (see [bbpress forum for discusion](https://bbpress.org/forums/topic/what-is-the-status-of-threaded-nested-replies-and-pagination/#post-207457))
<?php
//------------------------------------------------------//
// Add pagination to topics
//------------------------------------------------------//
function wpup_bbp_list_replies($args)
{
// Reset the reply depth
bbpress()->reply_query->reply_depth = 0;
(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
});
{"lastUpload":"2021-06-14T13:02:41.084Z","extensionVersion":"v3.4.3"}
@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
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'),
]);