Skip to content

Instantly share code, notes, and snippets.


Pieter Bos senlin

View GitHub Profile
senlin / contribution-svg.rb
Created Sep 26, 2018 — 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 Feb 3, 2019
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 Jan 3, 2018 — 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 / single-share.php
Last active Jan 31, 2016
Single share template part used to add social media sharing links under the Single Post. See LinkedIn WordPress Group Discussion
View single-share.php
* Template Part to show social media sharing on Single Posts
* look up the different sharing links at the resp. media sites
* replace username on line 22 with your own Twitter username
* replace textdomain with slug of your theme
* save this file in the folder template-parts (add it if you don't have it)
* call the template part by adding the following line after the `entry-content` div on your `single.php` template:
senlin / language-independent-acf-theme-options-output.php
Last active Feb 2, 2022
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 / so-first-image.php
Created Oct 13, 2015
grab first image of a Post if author has not added the Featured Image. If no images in the Post, then a default image will be selected. This default image is pulled from the images folder of the (child)theme. Made this snippet following this LinkedIn discussion:
View so-first-image.php
* Function that grabs the first image in a Post
* If there is no image, then it loads a default image
* @source: //
// add this function to your functions.php file or to your functionality file or plugin
View has-site-icon-snippet.php
if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) {
// Output old, custom favicon feature.
senlin / category.php
Created Aug 28, 2015
adapted category template to make a specific category temporarily unavailable (used TwentyFourteen templates). Original question via LinkedIn:
View category.php
* The template for displaying Category pages
* Change the number of the category you want to make inaccessible
* on line 21
* @link
* @package WordPress
senlin / index-loop.php
Created Aug 27, 2015
The while loop of the index.php that could be used to solve the issue of showing excerpts to visitors and full content to logged in users
View index-loop.php
* Sample loop that can be used on index.php template to show full content to logged-in users
* and excerpts to visitors.
* ### IMPORTANT: ###
* ### Theme should use separate template for homepage for this to work. ###
* @original question: //
senlin / Three Wise
Last active Feb 6, 2018 — 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?