Skip to content

Instantly share code, notes, and snippets.


Pieter Bos senlin

View GitHub Profile
senlin / contribution-svg.rb
Created September 26, 2018 09:32 — forked from jcouyang/contribution-svg.rb
SVG image for your github contributions calendar
View contribution-svg.rb
require "nokogiri"
require "open-uri"
url = "{params['username']}"
document = Nokogiri::HTML(open(url))
contrib_boxes = document.css('svg.js-calendar-graph-svg')[0]
width = (params['width']||54*13-2).to_i
height = (params['height']||89).to_i
senlin / classic-editor-addon.php
Last active February 3, 2019 03:13
Classic Editor Addon by SO WP & Greg Schoppe - Classic Editor plugin doesn't remove Gutenberg by default. With this addon function we set the option that controls this from no-replace to replace, we remove the Settings link from the main Plugins page and we hide the Settings from the Settings > Writing screen. We also suppress the Nag screen tha…
View classic-editor-addon.php
* Plugin Name: Classic Editor Addon
* Plugin Author: Pieter Bos ( and Greg Schoppe (
* Description: The Classic Editor plugin doesn't remove Gutenberg by default. With this function we set the option that controls this from no-replace to replace and we remove the Settings link from the main Plugins page
function classic_editor_addon_hardcode_replace( $value ) {
return 'replace';
senlin / controllers--contact.php
Created January 3, 2018 18:05 — forked from bastianallgeier/controllers--contact.php
Plain contactform example for Kirby 2
View controllers--contact.php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
senlin / language-independent-acf-theme-options-output.php
Last active October 26, 2022 05:44
How to get language independent ACF theme options on a WPML site
View language-independent-acf-theme-options-output.php
* To get this to work, you need to tinker with the acf/settings/ filter and reset the default language
* so that the get_field() function returns the correct results even when not on the default language.
* You can add the filter before you call the get_field() function and then call it again with the current
* language to reset it again, so it will affect other pages.
* answer courtesy of James of ACF Support
senlin / Three Wise
Last active February 6, 2018 11:34 — forked from malarkey/Three Wise
Three Wise Monkeys (NDA)
View Three Wise

Date: [date]

Between us [company name] and you [customer name].


In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

View gw-gravity-forms-map-fields-to-field.php
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
* Preview your Gravity forms on the frontend of your website. Adds a "Live Preview" link to the Gravity Forms toolbar.
* Usage
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
View custom_posttype_glance.php
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* -
* -
* now you can't use 'right_now_*' action API to show your custom post type count from your Dashboard.
* But if you running WP 3.8 or above, you can use 'dashboard_glance_items' instead.
* @package Wordpress
senlin / sButton.php
Last active August 29, 2015 14:19
Issue with WordPress shortcodes When I insert '[button]Button text[/button]' into a page, automatically <br /> tags comes before and after it, but I do not want that to happen. OP:
View sButton.php
function sButton( $atts, $content = null ) {
'link' => '#',
'grootte' => 'klein',
'id' => '1',
'randen' => ''
), $atts )
senlin / wpml-config.xml
Created August 2, 2014 01:42
WPML configuration file for the TOC+ WordPress plugin. The plugin comes with 5 variables in the Settings that cannot be translated. If you are running a multilingual website with WPML just add this file to the root of the plugin and you will see the 5 strings show up in the String Translations
View wpml-config.xml
<key name="toc-options">
<key name="heading_text" />
<key name="visibility_show" />
<key name="visibility_hide" />
<key name="sitemap_pages" />
<key name="sitemap_categories" />
View gw-gravity-forms-minimum-characters.php
* Gravity Wiz // Require Minimum Character Limit for Gravity Forms
* Adds support for requiring a minimum number of characters for text-based Gravity Form fields.
* @version 1.0
* @author David Smith <>
* @license GPL-2.0+
* @link