Skip to content

Instantly share code, notes, and snippets.

Avatar

Vincent Prat vpratfr

View GitHub Profile
View AssetUriFetcher.java
package com.wannacorp.util.glide;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetManager;
import android.net.Uri;
import android.util.Log;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
@vpratfr
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
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 ) {
You can’t perform that action at this time.