Skip to content

Instantly share code, notes, and snippets.

Avatar

Caspar Hübinger glueckpress

View GitHub Profile
@glueckpress
glueckpress / px-rem-cheat-sheet.css
Created May 26, 2013
Cheat sheet for rem-calculations based upon 14px and 16px.
View px-rem-cheat-sheet.css
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem
View _process.scss
$colours:
"red" #FF0000,
"blue" #001EFF,
"green" #00FF00,
"yellow" #F6FF00;
@each $i in $colours{
.#{nth($i, 1)}-background {
background: nth($i, 2);
}
@glueckpress
glueckpress / wp-rocket-custom.php
Created Dec 31, 2015
[WordPress][WP Rocket] Boilerplate for a custom functionality (MU) plugin.
View wp-rocket-custom.php
<?php
/**
* Plugin Name: Your Custom Functionality Plugin
* Description: Short description of your plugin here.
* Author: your name here
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
// Basic security, prevents file from being loaded directly.
@glueckpress
glueckpress / footer.php
Last active Nov 16, 2020
[WordPress] Offer filterable text strings in WordPress themes and child themes. Makes it easy to adjust original text, fully translatable. Example footer.php borrowed from _s (underscores) starter theme by @Automattic. http://glck.be/5740/
View footer.php
@glueckpress
glueckpress / exclude
Last active Oct 29, 2020
[git] Exclude .gitignore and all of WordPress, except specified directories
View exclude
# Sample of .git/info/exclude
# Documentation: https://git-scm.com/docs/gitignore
# Exclude .gitignore file.
# If an initial .gitignore file has been added to the repo,
# you might have to delete it first and sync the change.
# Then create a new one which will be excluded according to this rule.
.gitignore
# Exclude all of WordPress, but keep these directories synced:
@glueckpress
glueckpress / GitHub-Desktop-Bitbucket.md
Last active Oct 4, 2020
[How-to] Use GitHub Desktop to clone and commit to a Bitbucket repository just as you would with any GitHub repository. (Mac)
View GitHub-Desktop-Bitbucket.md

⚠️ Note: this guide is from 2016 – a long time on the internet. Content may be outdated, check the comments for more recent info.


Clone Bitbucket Repository and Add it to GitHub Desktop App (Mac)

You can’t clone a Bitbucket repo using GithHub Desktop directly. Instead you would have to:

  1. Clone the Bitbucket repo locally via command line.
  2. Add the cloned repository to your GitHub Desktop app.
View ciao.md

Find me at @casparhubinger

I retired my @glueckpress GitHub account. My active account is @casparhubinger.

@glueckpress
glueckpress / sample-admin-notice.php
Last active Sep 28, 2020
[WordPress] Sample Admin Notices
View sample-admin-notice.php
<?php
defined( 'ABSPATH' ) or die( 'Poop.' );
/**
* Plugin Name: _Sample Admin Notice
* Description: Displays a sample admin notice once for admins. (Requires PHP 5.3+.)
* Version: 0.1
* Author: Caspar Hübinger
* Plugin URI: https://gist.github.com/glueckpress/6befeb937da89025d4d8#file-sample-admin-notice-php
* Author URI: https://profiles.wordpress.org/glueckpress
* License: GNU General Public License v3
@glueckpress
glueckpress / q.css
Created Dec 10, 2015
Localized quotation marks for <q> element.
View q.css
/* Default quotation mark fallback:
* "This is a quotaion."
*/
q::before {
content: open-quote;
}
q::after {
content: close-quote;
}
@glueckpress
glueckpress / woocommerce-delete-customer-ip.php
Created Jan 9, 2014
Snippet to clear customer IP address when order is sent. #woocommerce #wordpress
View woocommerce-delete-customer-ip.php
<?php
/**
* Snippet for deleting the customer IP address from WooCommerce orders.
* Important for Trusted Shops® certificates in Germany.
*/
add_action( 'woocommerce_checkout_update_order_meta', 'mp1401091554', 1 );
function mp1401091554( $order_id ) {
update_post_meta(
$order_id,
'_customer_ip_address',