Skip to content

Instantly share code, notes, and snippets.

View carmoreira's full-sized avatar

Carlos Moreira carmoreira

View GitHub Profile
maucherOnline / freemius-google-analytics.js
Last active March 1, 2023 12:44
Include Google Analytics tracking in freemius checkout
View freemius-google-analytics.js
<script src=""></script>
var handler = FS.Checkout.configure({
plugin_id: 'xxxxx',
plan_id: 'xxxxx',
public_key: 'pk_yyyyyyyyyyyyyyyyyy',
image: ''
jQuery('.purchase, a[href*="#purchase"').on('click', function (e) {
rniswonger / wp-disable-plugin-update.php
Last active October 19, 2023 15:15
WordPress - Disable specific plugin update check
View wp-disable-plugin-update.php
* Prevent update notification for plugin
* Place in theme functions.php or at bottom of wp-config.php
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
imraheel / Rating Stars
Last active March 3, 2019 03:33
Rating stars with font awesome and simple css :)
View Rating Stars
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Rating Stars</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="">
PurpleBooth /
Last active December 1, 2023 15:55
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


yratof / gist:c3295a5bbf68641884c6
Created June 29, 2015 15:30
MySQL Fix for MAMP PRO when using WP CLI
View gist:c3295a5bbf68641884c6
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql;
sudo ln -s /Applications/MAMP/Library/bin/mysqlcheck /usr/local/bin/mysqlcheck;
sudo ln -s /Applications/MAMP/Library/bin/mysqldump /usr/local/bin/mysqldump
nmsdvid / new_gist_file.js
Created February 4, 2014 16:32
Simple JavaScript Debounce Function
View new_gist_file.js
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
hofmannsven /
Last active November 24, 2023 06:10
Git Cheatsheet
justinph / validate_gravatar.php
Created March 19, 2013 16:49
In wordpress, a better way to check if an author has a gravatar or not. Sometimes you might want to check to see if a gravatar exists and not display any image if there isn't one. Uses the wordpress HTTP and caching apis. A better version of this:
View validate_gravatar.php
* Utility function to check if a gravatar exists for a given email or id
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @return bool if the gravatar exists or not
function validate_gravatar($id_or_email) {
//id or email code borrowed from wp-includes/pluggable.php
$email = '';
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
View grayscale-disable.css
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
jakebellacera / ICS.php
Last active November 23, 2023 15:30
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
* This is free and unencumbered software released into the public domain.
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.