Skip to content

Instantly share code, notes, and snippets.

Avatar

Jake Jackson jakejackson1

View GitHub Profile
@alexkingorg
alexkingorg / hex_color_mod.php
Created Sep 3, 2011
Change the brightness of the passed in hex color in PHP
View hex_color_mod.php
<?php
/**
* Change the brightness of the passed in color
*
* $diff should be negative to go darker, positive to go lighter and
* is subtracted from the decimal (0-255) value of the color
*
* @param string $hex color to be modified
* @param string $diff amount to change the color
@andreyvit
andreyvit / fpdi_with_annots.php
Created Mar 12, 2012
FPDI extension to preserve external hyperlinks
View fpdi_with_annots.php
<?php
// FPDI extension that preserves hyperlinks when copying PDF pages.
//
// (c) 2012, Andrey Tarantsov <andrey@tarantsov.com>, provided under the MIT license.
//
// Published at: https://gist.github.com/2020422
//
// Note: the free version of FPDI requires unprotected PDFs conforming to spec version 1.4.
// I use qpdf (http://qpdf.sourceforge.net/) to preprocess PDFs before running through this
@spivurno
spivurno / gw-gravity-forms-advanced-merge-tags.php
Last active Nov 12, 2021
Gravity Wiz // Gravity Forms // Advanced Merge Tags
View gw-gravity-forms-advanced-merge-tags.php
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Merge Tags
*
* Adds support for several advanced merge tags:
* + post:id=xx&prop=xxx
* retrieve the desired property of the specified post (by ID)
* + post_meta:id=xx&meta_key=xxx
* retrieve the desired post meta value from the specified post and meta key
* + get() modifier
@adamcapriola
adamcapriola / page_discourse-sso.php
Last active Mar 24, 2020
WordPress Page Template for SSO with Discourse
View page_discourse-sso.php
<?php
/**
* Template Name: Discourse SSO
* Author: Adam Capriola
* Version: 1.1
* Author URI: https://meta.discourse.org/users/AdamCapriola/activity
* Adapted From: https://github.com/ArmedGuy/discourse_sso_php
* Uses: https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
*
*/