Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Kirki Sass Compiler
*
* Create a CSS file based on a SCSS-file and Kirki variables
* File gets saved in the public folder with a cache buster.
*/
namespace App\Kirki;
use ScssPhp\ScssPhp\Compiler;
/*
* URL updates and the element focus is maintained
*
* originally found via in Update 3 on http://www.learningjquery.com/2007/10/improved-animated-scrolling-script-for-same-page-links
* Author: HEATHER MIGLIORISI
* URL: https://css-tricks.com/smooth-scrolling-accessibility/
*/
// filter handling for a /dir/ OR /indexordefault.page
function filterPath(string) {
@Robbertdk
Robbertdk / Google-analytics-wp-themes.php
Last active January 18, 2016 10:08
Google Analytics include in Wordpress themes functions.php
function my_theme_google_analytics() { ?>
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','GOOGLE ANALYTICS ID');ga('send','pageview');
</script>
<?php }
@Robbertdk
Robbertdk / Vertical Orbit Slider.markdown
Created December 9, 2015 10:47
Vertical Orbit Slider
@Robbertdk
Robbertdk / Custom jQuery Validate
Last active November 25, 2015 13:52
Custom jQuery Validate methods
/*
* Custom method to make a yes no radio box only validate on yes
*/
addSelectiveRadioMethod: function(){
jQuery.validator.addMethod("requiredRadioValue", function(value, element, params) {
var selectedValue = $('input:radio[name=' + element.name + ']:checked').val();
return selectedValue === params;
}, "You must select the required option.");
},
@Robbertdk
Robbertdk / markdown-dummy
Last active April 17, 2024 19:53
Markdown dummy content. Dummy content for the most used HTML text elements. Useful for a thorough design of a text
# One morning, when Gregor Samsa woke from troubled dreams.
One morning, when Gregor Samsa woke from troubled dreams, he found himself *transformed* in his bed into a horrible [vermin](http://en.wikipedia.org/wiki/Vermin "Wikipedia Vermin"). He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover **strong** it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, link waved abouthelplessly as he looked. <cite>“What's happened to me?”</cite> he thought. It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls.</p>
## The bedding was hardly able to cover it.
It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer a solid fur muff into which her entir
@Robbertdk
Robbertdk / @goodbite - nieuwsbrief - Uitgelichte button
Last active August 29, 2015 14:06
gecentreerd, met groene achtergrond
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" class="center button-primary-container center" mc:edit="featured_content_cat">
<a href="http://www.goodbite.nl" target="_blank">bekijk de burger</a>
</td>
</tr>
</table>
</center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="button-default-container">
<a href="http://www.goodbite.nl" target="_blank">Bekijk recept</a>
</td>
</tr>
</table>
@Robbertdk
Robbertdk / all attached image sizes
Created August 19, 2014 10:28
WordPress: Get the urls of all the attached image sizes
<?php
/**
* Get the urls of all the attached image sizes
*
* Array with image urls given when a correct image attachment ID is passed.
* similiar to core function wp_get_attachment_image() but for all the images.
* Biggest adventage is one db query for all intermediate_image_sizes
*
* @param int $post_id Attachment ID.
@Robbertdk
Robbertdk / antispam_shortcode
Last active August 29, 2015 14:03
Anti spam e-mail in Wordpress
<?php
function antispambot_sc( $atts ) {
extract( shortcode_atts( array(
'email' => ''
), $atts ) );
return antispambot( $email );
}
add_shortcode( 'antispambot', 'antispambot_sc' );
// Usage: [antispambot email="my.cloaked.email.address@gmail.com"]
?>