Skip to content

Instantly share code, notes, and snippets.

View seedprod's full-sized avatar

John Turner seedprod

View GitHub Profile
@seedprod
seedprod / yql-cross-domain.html
Created December 2, 2010 21:14
Cross Domain Request without busting YQL's cache
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross Domain Request without busting YQL's cache</title>
<style type="text/css">
#request { text-align: center; }
</style>
</head>
<body>
@seedprod
seedprod / googleHacks.py
Created December 3, 2010 02:22
Find out if your site can be found via google dorks
#Find out if your site can be found via google dorks
from BeautifulSoup import BeautifulSoup
import re
import urllib2
siteURL = "johndturner.com"
#get ghdb page. iterate through all links available
page = urllib2.urlopen("http://www.hackersforcharity.org/ghdb/")
soup = BeautifulSoup(page)
@seedprod
seedprod / changeowner.sh
Created February 21, 2011 12:56
Recursive change owner
for i in /home/COUGARS/*;do base=$(basename $i); chown -R $base:'domain users' $i; done
@seedprod
seedprod / example-page.php
Created March 3, 2011 14:00
Mobile php buffer method
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<!--#START-ROOT-CODE
<?php
$docRoot = '/var/www/html';
require_once($docRoot .'/scripts/global-pre.php');
?>
#END-ROOT-CODE-->
<head>
@seedprod
seedprod / hhwebservcie.php
Created April 7, 2011 12:45
Hannon Hill Web Service Call
<?php
//include("web_services_util.php");
$client = new SoapClient ( "https://server:8443/ws/services/AssetOperationService?wsdl", array ('trace' => 1 ) );
$auth = array ('username' => 'username', 'password' => 'password' );
$id = array ('type' => 'page', 'id' => '261f20de8a4e31910086b7bbfb175968' );
$params = array ('authentication' => $auth, 'identifier' => $id );
// publish asset
$reply = $client->publish ( $params );
@seedprod
seedprod / gist:1181262
Created August 30, 2011 16:11
WordPress Color Picker
<input type="text" name="my-theme-options[color]" id="color" />
<input type='button' class='pickcolor button-secondary' value='Select Color'>
<div id='colorpicker' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div>
// Color Picker for js file
$('.pickcolor').click( function(e) {
colorPicker = jQuery(this).next('div');
input = jQuery(this).prev('input');
$(colorPicker).farbtastic(input);
colorPicker.show();
@seedprod
seedprod / vt_resize.php
Created November 15, 2011 14:45
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php
@seedprod
seedprod / gist:2995920
Created June 26, 2012 13:55
Create Amazon S3 expiring link
$product_details = seedprod_get_product_info($slug);
$api_key_details = seedprod_get_api_key_info($api_key);
$version = trim($product_details['version']);
require_once 'amazons3-php/sdk.class.php';
$s3 = new AmazonS3();
$download_link = $s3->get_object_url('static.seedprod.com', 'files/'.$slug.'-'.$version.'.zip', '48 hours');
<div class="row-fluid">
<div class="span6">...</div>
<div class="span6">...</div>
</div>
<div class="row-fluid">
<div class="span4">...</div>
<div class="span4">...</div>
<div class="span4">...</div>
// Assign payment to users second payments
add_action( 'edd_insert_payment', array( $this, 'insert_payment' ), 10, 2 );
public function insert_payment($payment, $payment_data ){
// assign user to payment
$user = get_user_by( 'email', $payment_data['user_email'] );
update_post_meta( $payment, '_edd_payment_user_id', $user->ID );