Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@richardtorres314
richardtorres314 / flexbox.scss
Last active March 4, 2024 14:41
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@dparker1005
dparker1005 / checkout_levels_api_demo.php
Last active February 29, 2024 18:06
2 demos to demonstrate the PMPro checkout_levels API call.
<?php
// Copy from below here...
/*
* Add widget to checkout to get result of checkout_levels API call when button is pressed.
*/
function my_pmpro_test_checkout_levels_api() {
?>
<hr/>
<?php
/**
* This recipe will geocode the members based on their user account only.
* Run /wp-admin/?pmpromm_process_users=true to run the script.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@andrewlimaza
andrewlimaza / my-pmpro-change-admin-email.php
Last active February 28, 2024 11:31
Change the admin email for all Paid Memberships Pro admin emails.
<?php
/**
* Change the email address for all admin related emails in Paid Memberships Pro.
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $user_email, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
$user_email = 'memberadmin@someemail.co';
}
@andrewlimaza
andrewlimaza / show-password-login-toggle.php
Created December 10, 2020 09:21
Add a 'Show Password' on Paid Memberships Pro login page.
<?php
/**
* Add a checkbox to frontend login page of WordPress to toggle the password text visible/hidden.
*
* Add this code to a custom plugin or Code Snippets Add On: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Source: https://www.w3schools.com/howto/howto_js_toggle_password.asp
*/
function my_pmpro_show_password_login_toggle( $items, $args ) {
@jareware
jareware / SCSS.md
Last active February 13, 2024 14:33
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@jonathantneal
jonathantneal / README.md
Last active February 8, 2024 10:53
Nearest Normal Ratio Calculator

Nearest Normal Aspect Ratio

This function returns the nearest aspect ratio of a width and height within a limited range of possible aspect ratios.

In other words, while 649x360 technically has an aspect ratio of 649:360, it’s often useful to know that the nearest normal aspect ratio is actually 9:5 (648x360).

nearestNormalAspectRatio(width, height, [side], [maxWidth], [maxHeight])
@andrewlimaza
andrewlimaza / pmpro-approvals-login-example.php
Created July 24, 2018 10:34
Stop non-approved users from logging in.
<?php
/**
* This is an example to stop non-approved user's from logging in using the Approvals Add On For Paid Memberships Pro.
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_stop_users_logging_in( $user, $password ) {
$user_id = $user->ID;
@carlodaniele
carlodaniele / kinsta-share-users.php
Last active December 11, 2023 15:34
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@kamikat
kamikat / trig.scss
Last active December 7, 2023 12:50
SCSS/SASS module calculating sin/cos/tan using Taylor Expansion.
///////////////////////////////////////////////////////////
// Plain SASS Trigonometry Algorithm in Taylor Expansion //
// //
// Based on //
// http://japborst.net/posts/sass-sines-and-cosines //
///////////////////////////////////////////////////////////
$pi: 3.14159265359;
$_precision: 10;