Skip to content

Instantly share code, notes, and snippets.


Vincent Prat vpratfr

View GitHub Profile
package com.wannacorp.util.glide;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
import com.bumptech.glide.Priority;
vpratfr / post-receive
Created Aug 2, 2014
Bash script to automatically deploy a web project
View post-receive
## 1. Create git repo in user's home
cd /home/myuser
mkdir git
mkdir web.git
cd /home/myuser/git/web.git
git init --bare
## 2. Put the post-receive script in there
vpratfr / edd_custom_licencing.php
Created Feb 12, 2014
EDD - Custom acitivation limit and expiration dates for variable pricing and bundles
View edd_custom_licencing.php
* Function to consolidate purchase data because info is missing from edd_get_payment_meta_cart_details
function mlabs_get_product_price_id_for_purchase( $download_id, $payment_id ) {
$purchase_details = edd_get_payment_meta_cart_details( $payment_id, true );
if ( !is_array( $purchase_details ) ) return false;
foreach( $purchase_details as $item ) {
if( $item['id'] == $download_id ) {