Skip to content

Instantly share code, notes, and snippets.

View jordygrunn's full-sized avatar
🚀

Jordy Bakker jordygrunn

🚀
View GitHub Profile
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active May 2, 2024 16:43
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@jsn789
jsn789 / add-gtm-wp.php
Last active March 28, 2023 15:38
Add Google Tag Manager through functions.php in WordPress
/* Add Google Tag Manager javascript code as close to
the opening <head> tag as possible
=====================================================*/
function add_gtm_head(){
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@jarnesjo
jarnesjo / category.php
Created February 10, 2014 12:11
Create pagination with numbers in WordPress
<?php
// Pagniation
global $wp_query;
$big = 999999999; // need an unlikely integer
echo '<nav id="pagination" class="col-sm-12">';
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '/page/%#%',
'end_size' => 0,
@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@tinotriste
tinotriste / breadcrumbs-functions.php
Last active April 20, 2024 05:36
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
@lunohodov
lunohodov / ral_classic.csv
Last active April 24, 2024 01:14
RAL Classic color table (CSV)
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 11 columns, instead of 4. in line 9.
RAL,RGB,HEX,CMYK,LRV,English,German,French,Spanish,Italian,Dutch
RAL 1000,205-186-136,#CDBA88,0-9-34-20,51.79,Green beige,Grünbeige,Beige vert,Beige verdoso,Beige verdastro,Groenbeige
RAL 1001,208-176-132,#D0B084,0-15-37-18,48.09,Beige,Beige,Beige,Beige,Beige,Beige
RAL 1002,210-170-109,#D2AA6D,0-19-48-18,45.07,Sand yellow,Sandgelb,Jaune sable,Amarillo arena,Giallo sabbia,Zandgeel
RAL 1003,249-169-0,#F9A900,0-32-100-2,49.05,Signal yellow,Signalgelb,Jaune de sécurité,Amarillo señales,Giallo segnale,Signaalgeel
RAL 1004,228-158-0,#E49E00,0-31-100-11,42.13,Golden yellow,Goldgelb,Jaune or,Amarillo oro,Giallo oro,Goudgeel
RAL 1005,203-143-0,#CB8F00,0-30-100-20,34.15,Honey yellow,Honiggelb,Jaune miel,Amarillo miel,Giallo miele,Honinggeel
RAL 1006,225-144-0,#E19000,0-36-100-12,37.45,Maize yellow,Maisgelb,Jaune maïs,Amarillo maíz,Giallo polenta,Maisgeel
RAL 1007,232-140-0,#E88C00,0-40-100-9,37.63,Daffodil yellow,Narzissengelb,Jaune narcisse,Amarillo narciso,Giallo narciso,Narcissengeel
RAL 1011,175-128-80,#AF8050,0-27
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}