Skip to content

Instantly share code, notes, and snippets.


Theuns Coetzee ipokkel

View GitHub Profile
ipokkel / add-billing-fields-to-user-profile-edit.php
Last active Aug 19, 2022
Add PMPro Billing Address fields to the user profile edit pages.
View add-billing-fields-to-user-profile-edit.php
* This will add billing fields to the administrative user profile edit page for administrators
* and on the frontend PMPro user Edit Profile page for members.
* 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.
vasanthk / System
Last active Aug 19, 2022
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
hofmannsven /
Last active Aug 18, 2022
SCSS Cheatsheet
jonathantneal /
Last active Aug 17, 2022
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])
berkorbay /
Last active Aug 14, 2022
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows
andrewlimaza / pmpro_allow_access_for_admins.php
Last active Aug 12, 2022
Allow admins, administrator, administrators access to all restricted posts in WordPress with Paid Memberships Pro
View pmpro_allow_access_for_admins.php
* This code snippet allows admins without any PMPro membership level to access any restricted content.
* Add this code to your PMPro Customizations plugin -
function pmmpro_allow_access_for_admins($hasaccess, $mypost, $myuser, $post_membership_levels){
//If user is an admin allow access.
if( current_user_can( 'manage_options' ) ){

Font Face

A mixin for writing @font-face rules in SASS.


Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
richardtorres314 / flexbox.scss
Last active Aug 8, 2022
CSS Flexbox - Sass Mixins
View flexbox.scss
// --------------------------------------------------
// Flexbox SASS mixins
// The spec:
// --------------------------------------------------
// Flexbox display
@mixin flexbox {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
jareware /
Last active Aug 7, 2022
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at

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

andrewlimaza / change_text_example.php
Last active Aug 4, 2022
gettext change level cost text
View change_text_example.php
// Add this code below to your PMPro Customizations plugin -
add_filter( 'gettext', 'change_my_cost_example', 20, 3 );
* @link
function change_my_cost_example( $translated_text, $text, $domain ) {