This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <wand/MagickWand.h> | |
int count = 0; | |
void processdir(const char *name, const int min_edge, const int quality, const int dry_run) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Single Event Meta (Additional Fields) Template | |
* | |
* Override this template in your own theme by creating a file at: | |
* [your-theme]/tribe-events/pro/modules/meta/additional-fields.php | |
* | |
* @package TribeEventsCalendarPro | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function have_https_for_media( $url ) { | |
if ( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} | |
add_filter( 'wp_get_attachment_url', 'have_https_for_media' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$items = array( | |
1 => array( 'item' => explode( '|', rgar( $entry, '20' ) ), 'title' => rgar( $entry, '5' ), 'name' => rgar( $entry, '7' ), 'company' => rgar( $entry, '8' ), 'position' => rgar( $entry, '9' ), 'address_1' => rgar( $entry, '10.1' ), 'address_2' => rgar( $entry, '10.2' ), 'city' => rgar( $entry, '10.3' ), 'state' => rgar( $entry, '10.4' ), 'zip' => rgar( $entry, '10.5' ), 'country' => rgar( $entry, '10.6' ), 'phone' => rgar( $entry, '33' ), 'fax' => rgar( $entry, '11' ), 'old_pos' => rgar( $entry, '13' ), 'emp_dates' => rgar( $entry, '14' ), 'contact_rel' => rgar( $entry, '15' ), 'new_pos' => rgar( $entry, '18' ), 'reason_left' => rgar( $entry, '16' ), 'last_sal' => rgar( $entry, '17' ), 'add_notes' => rgar( $entry, '21' ), 'rush' => explode( '|', rgar( $entry, '22.1' ) ), 'international' => explode( '|', rgar( $entry, '23.1' ) ) ), | |
2 => array( 'item' => explode( '|', rgar( $entry, '46' ) ), 'title' => rgar( $entry, '49' ), 'name' => rgar( $entry, '51' ), 'company' => rgar( $entry, '52' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Wiz // Gravity Forms // Populate Field from One Page to Field in Subsequent Page | |
* http://gravitywiz.com/ | |
*/ | |
// update "1074" to the ID of your form | |
add_filter( 'gform_pre_render_1074', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// update "2" to the field ID on the later page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mail_from() { | |
$emailaddress = 'contact@1stwebdesigner.com'; | |
return $emailaddress; | |
} | |
function mail_from_name() { | |
$sendername = "1stWebDesigner.com - Dainis"; | |
return $sendername; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import datetime | |
editor.beginUndoAction() | |
def calculate(match): | |
epoch = datetime.datetime(1970, 1, 1) | |
s = "%s/%s/%s" % (match.group(1), match.group(2), match.group(3)) | |
t = datetime.datetime.strptime(s, "%Y/%m/%d") | |
diff = t-epoch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function clear_jetpack_published() { | |
if(empty($_REQUEST['post'])) { | |
wp_die(__('Invalid post ID or action')); | |
} | |
global $wpdb; | |
$id = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//make sure your page access token has the 'publish_actions' scope | |
$access_token = 'YOURACCESSTOKEN'; | |
$pageid = 'YOURPAGEID'; | |
//fb graph api only allows this to be up to 100 | |
$limit = '100'; | |
//retireve posts on specific page ID: | |
$fb_ret_url = 'https://graph.facebook.com/' . $pageid . '/posts?limit=' . $limit . '&access_token=' . $access_token; |