Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active March 11, 2024 05:12
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?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.
*
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&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%);
}
@justinph
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: http://codex.wordpress.org/Using_Gravatars#Checking_for_the_Existence_of_a_Gravatar
/**
* 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 = '';
@hofmannsven
hofmannsven / README.md
Last active March 22, 2024 19:45
Git CLI Cheatsheet
@nmsdvid
nmsdvid / new_gist_file.js
Created February 4, 2014 16:32
Simple JavaScript Debounce Function
// 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;
clearTimeout(timeout);
@yratof
yratof / gist:c3295a5bbf68641884c6
Created June 29, 2015 15:30
MySQL Fix for MAMP PRO when using WP CLI
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
@PurpleBooth
PurpleBooth / README-Template.md
Last active March 24, 2024 02:11
A template to make good README.md

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.

Prerequisites

@imraheel
imraheel / Rating Stars
Last active March 3, 2019 03:33
Rating stars with font awesome and simple css :)
<!DOCTYPE html>
<html>
<head>
<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="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style>
@rniswonger
rniswonger / wp-disable-plugin-update.php
Last active January 3, 2024 15:21
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* 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'] );
}
@maucherOnline
maucherOnline / freemius-google-analytics.js
Last active March 1, 2023 12:44
Include Google Analytics tracking in freemius checkout
<script src="https://checkout.freemius.com/checkout.min.js"></script>
<script>
var handler = FS.Checkout.configure({
plugin_id: 'xxxxx',
plan_id: 'xxxxx',
public_key: 'pk_yyyyyyyyyyyyyyyyyy',
image: 'https://yyy.com/Logo-SVG.svg'
});
jQuery('.purchase, a[href*="#purchase"').on('click', function (e) {