Skip to content

Instantly share code, notes, and snippets.

View vpratfr's full-sized avatar

Vincent Prat vpratfr

View GitHub Profile
@vpratfr
vpratfr / edd_custom_licencing.php
Created February 12, 2014 09:25
EDD - Custom acitivation limit and expiration dates for variable pricing and bundles
/**
* 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 ) {
@vpratfr
vpratfr / post-receive
Created August 2, 2014 11:24
Bash script to automatically deploy a web project
## 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
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;