Skip to content

Instantly share code, notes, and snippets.

View wgroenewold's full-sized avatar

Wouter Groenewold wgroenewold

  • GH+O Communicatie
View GitHub Profile
@wgroenewold
wgroenewold / greasemonkey.js
Last active March 5, 2024 13:13
Greasemonkey script to auto-click "Join now" in a Google Meet screen.
// ==UserScript==
// @name Click
// @version 0.1
// @match *://meet.google.com/*
// @author woutergroenewold
// @grant GM_addStyle
// @require http://code.jquery.com/jquery-2.1.0.min.js
// ==/UserScript==
//- The @grant directive is needed to restore the proper sandbox.
@wgroenewold
wgroenewold / deploy-instance.tf
Created April 21, 2023 12:42
Deploy an instance on Merlin (or Habrok)
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.48.0"
}
}
}
@wgroenewold
wgroenewold / playbook.yml
Created January 17, 2023 13:36
Create an instance on merlin cluster (RUG) in Ansible
---
- name: Create an instance on merlin cluster (RUG) in Ansible
hosts: localhost
remote_user: "{{ merlin_username }}"
vars:
ansible_python_interpreter: python
openstack_api_timeout: 180
os_auth: {
'auth_url': '',
'password': '',
@wgroenewold
wgroenewold / reinit.js
Created November 4, 2021 15:41
Reinit datepicker fields in Gravity Forms when used in repeater
$(document).on("click", ".gfield_repeater_buttons button", function(){
$('.datepicker').each(function(){
$(this).datepicker({
yearRange: '-100:+20',
showOn: 'focus',
dateFormat: 'dd-mm-yyyy',
changeMonth: true,
changeYear: true,
suppressDatePicker: false,
});
@wgroenewold
wgroenewold / gist:f24b775b76ad528a7de7f43f23ef0fb6
Created March 25, 2021 13:37
mijnafvalwijzer.nl scrape to ics
curl 'https://www.mijnafvalwijzer.nl/' \
-H 'Connection: keep-alive' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
-H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'Origin: https://www.mijnafvalwijzer.nl' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' \
@wgroenewold
wgroenewold / get_aspect_ratio_from_acf.php
Created July 9, 2020 15:22
Calculate aspectratio from ACF oEmbed Field
<?php
public function get_aspect_ratio_from_acf($fieldname, $postid){
$url = get_field($fieldname, $postid, false);
$instance = new WP_oEmbed();
$data = $instance->get_data($url);
$ratio = $this->float2rat(($data->width/$data->height));
switch($ratio){
case '21/9':
{
"devDependencies": {
"commitizen": "^4.1.2",
"cz-conventional-changelog": "3.2.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog",
"maxHeaderWidth": 100,
"maxLineWidth": 100,
cache:
paths:
- vendor/
before_script:
# Install Docker
- bash ci/docker_install.sh > /dev/null
# Install SSH
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
@wgroenewold
wgroenewold / isup.sh
Created May 28, 2019 14:30
Check if NFS shares are still mounted, if not remount (needed for b0rked M$ NFS server)
#!/usr/bin/env bash
mounts=(/usr/share/mounts/folder1, /usr/share/mounts/folder2)
shares=(10.0.0.2:/folder1 10.0.0.2:/folder2)
for i in "${!shares[@]}";
do
if cat /proc/mounts | grep "${shares[$i]}" ; then
continue;
else
@wgroenewold
wgroenewold / st00pidM$.ps1
Last active September 28, 2022 09:49
Set all default permissions for all calendars in O365
Connect-ExchangeOnline -UserPrincipalName chris@contoso.com
$Mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {(RecipientTypeDetails -eq "UserMailbox") -and (Name -ne "beheer")}
foreach($Mailbox in $Mailboxes){$Calendar = Get-Mailbox -Identity "$($Mailbox.Name)" | Get-MailboxFolderStatistics -FolderScope calendar | sort-object Date; Set-MailboxFolderPermission -identity "$($Mailbox.Name):\$($Calendar[0].Name)" -AccessRights LimitedDetails -User Default; foreach ($User in $Mailboxes){if($User -ne $Mailbox){Set-MailboxFolderPermission -identity "$($Mailbox.Name):\$($Calendar[0].Name)" -AccessRights Editor -User $($User.Name)}}}
foreach($Mailbox in $Mailboxes){$Calendar = Get-Mailbox -Identity "$($Mailbox.Name)" | Get-MailboxFolderStatistics -FolderScope calendar | sort-object Date; Set-MailboxFolderPermission -identity "$($Mailbox.Name):\$($Calendar[0].Name)" -AccessRights LimitedDetails -User Default; foreach ($User in $Mailboxes){if($User -ne $Mailbox){Add-MailboxFolderPermission -identity "$($Mailbox