Skip to content

Instantly share code, notes, and snippets.

View ramiabraham's full-sized avatar

Rami Abraham ramiabraham

View GitHub Profile
@ramiabraham
ramiabraham / ie-can-suck-it.css
Created July 23, 2014 15:25
IE font smoothing :(
/* add other elements as needed */
h1, h2, h3, h4, h5, h6, p, li, td {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTJBQkFGRUZFOTIyMTFFMEJDRDNEQzkxOTVGOTNBODAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTJBQkFG
@ramiabraham
ramiabraham / affwp-url-referral-var-shortcode.php
Last active February 16, 2021 17:10
AffiliateWP Custom Referral URL
<?php
/*
Plugin Name: AffiliateWP Custom Referral URL
Plugin URI: http://affiliatewp.com
Description: Adds AffiliateWP Custom Referral URL
Version: 0.1
License: GPL
Author: AffiliateWP
*/
@ramiabraham
ramiabraham / gist:72e62a808a100d32a782
Created September 9, 2014 02:50
AffiliateWP Front-EndDashboard Stats For Current User
<?php
/*
Plugin Name: AffiliateWP Dashboard Stats For Current User
Plugin Script: affiliatewp dashboard stats.php
Plugin URI: http://affiliatewp.com
Description: Adds AffiliateWP Dashboard Stats For Current User
Version: 0.1
License: GPL
Author: AffiliateWP
@ramiabraham
ramiabraham / affwp-affiliate-id-shortcode.php
Last active August 29, 2015 14:06
Affiliate ID shortcode
<?php
/*
Plugin Name: AffiliateWP Affiliate ID Shortcode
Plugin URI: http://affiliatewp.com
Description: Adds a shortcode that displays the AffiliateWP affiliate id.
Version: 0.1
Author: AffiliateWP
Author URI: http://affiliatewp.com
*/
@ramiabraham
ramiabraham / sticky.js
Last active August 29, 2015 14:07
sticky div (typically a sidebar) with compat for touch devices
(function($) {
$(window).bind("load", function() {
var sidebar_one = $('#sidebar-1' );
var sidebar_two = $('#sidebar-2');
$( window ).scroll( function() {
if ( $(this).scrollTop() > 660 && $(this).width() > 1024 ) {
@ramiabraham
ramiabraham / edd.php
Last active August 29, 2015 14:07 — forked from amdrew/edd.php
<?php
/**
* Disable commission on an entire product category in Easy Digital Downloads
*/
function affwp_custom_wc_disable_commission_per_category( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) {
// Array of categories to disable commission for. Separate by a comma and use either the term name, term_id, or slug
$disabled_categories = array( 'category-one', 5 );
@ramiabraham
ramiabraham / gist:0ec0df2e67ed31331cc5
Created February 26, 2015 14:03
AffiliateWP - force pending / accepted referrals
<?php
// set as pending by default
// add_filter( 'affwp_auto_complete_referral', '__return_false' );
// set as accepted by default
add_filter( 'affwp_auto_complete_referral', '__return_true' );
@ramiabraham
ramiabraham / genesis-print-styles.php
Last active August 29, 2015 14:18
Minimum Genesis print styles
<?php
/**
* Minimum Genesis print styles
* Can be added via an @media print media query,
* or by enqueueing a print-style
* /
// Remove the media query wrapper if enqueueing a print style separately.
@ramiabraham
ramiabraham / set-affwp-reg-role.php
Last active August 29, 2015 14:20 — forked from pippinsplugins/gist:d973776836ab984aea06
Set affiliate role on registration
<?php
/*
* Plugin name: Affiliate role on registration
*/
function pw_affwp_set_role_on_registration( $affiliate_id = 0 ) {
$user_id = affwp_get_affiliate_user_id( $affiliate_id );
$user = new WP_User( $user_id );
$user->add_role( 'affiliate' );
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page