Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@garyharan
garyharan / _mixins.scss
Created May 5, 2011
Useful scss mixins (rounded corners, gradients, text-field, button)
View _mixins.scss
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@ScottPhillips
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@tsi
tsi / newsite
Last active May 27, 2018
Bash script to create virtual hosts and prepare your drupal directory.
View newsite
#!/bin/bash
# This script creates virtual hosts and prepares your mysql DB and drupal directory.
# you should put it under /usr/local/bin/
# and run it with sudo newsite
# Set the path to your localhost
www=/var/www
echo "Enter directory name under $www"
read sn
@strangerstudios
strangerstudios / gist:3100680
Created Jul 12, 2012
Hidden Levels for Paid Memberships Pro
View gist:3100680
<?php
/*
Plugin Name: PMPro Hidden Levels
Plugin URI: http://www.paidmembershipspro.com/pmpro-hidden-levels/
Description: With this plugin, select levels are removed from the levels page but still available for checkout if you visit the checkout URL directly.
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@jonathantneal
jonathantneal / README.md
Created Sep 19, 2012
Polyfill the EventListener interface in IE8
View README.md

EventListener Polyfill

Is IE8 your new IE6? Level the playing field with polyfills.

This script polyfills addEventListener, removeEventListener, and dispatchEvent. It is less than half a kilobyte minified and gzipped.

addEventListener

addEventListener registers a single event listener on a single target.

@jareware
jareware / SCSS.md
Last active May 17, 2021
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do
View SCSS.md

⇐ 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

@strangerstudios
strangerstudios / pmpro-cancel-on-billing-failure.php
Last active Dec 3, 2020
Cancel PMPro subscriptions when a recurring payment fails.
View pmpro-cancel-on-billing-failure.php
/*
Cancel subscriptions when a recurring payment fails. As of PMPro version 1.5.9.1, failed payments reported via Stripe webhook, PayPal IPN handler, or Authorize.net silent post kick off the pmpro_subscription_payment_failed action.
Also make sure to edit the default billing_failure.html email to mention that users are cancelled upon failure. To do so, copy paid-memberships-pro/email/billing_failure.html into themes/{active theme}/paid-memberships-pro/email/ and edit the text to suit your need.
Note: This cancels on the first failure. To cancel only when cancelling at Stripe, see this gist: https://gist.github.com/strangerstudios/5093710
*/
function my_pmpro_subscription_payment_failed($order)
{
//cancel the membership
@strangerstudios
strangerstudios / pmpro_email_filter_example.php
Last active Oct 31, 2020
Edit all PMPro email properties at once via pmpro_email_filter.
View pmpro_email_filter_example.php
/*
Edit email templates.
Other fields to change:
* $email->email
* $email->from
* $email->fromname
* $email->subject
* $email->template
* $email->body
View function.php
<?php
/**
* Render_Menu
* -----------------
* Render a menu using simple, semantic HTML
*
* Usage: new Render_Menu(@name)
*
* @name (string) name of the menu ("main-navigation")
@jonathantneal
jonathantneal / facebook.php
Last active Dec 8, 2020
Getting social media feeds as JSON in PHP
View facebook.php
<?php
/* Getting a JSON Facebook Feed
==========================================================================
1. Sign in as a developer at https://developers.facebook.com/
2. Click "Create New App" at https://developers.facebook.com/apps
3. Under Apps Settings, find the App ID and App Secret