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 | |
if (!file_exists('path/to/directory')) { | |
mkdir('path/to/directory', 0777, true); | |
} |
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
preload_image : function(image, callback) { | |
$preload_images = $('#preload-images'); | |
if($preload_images.size() < 1) | |
$preload_images = $('<div id="preload-images" style="display:none" />').prependTo('body'); | |
$preload_images.append('<img data-id="' + image.id + '"src="' + image.src + '" />'); | |
$preload_images.find(' img[data-id=' + image.id + ']').load(function(e){ | |
if(typeof(callback) == 'function') callback(); | |
}); | |
} |
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 | |
$pattern = array(0,0,0,1,2,2,2); | |
$news_array = array('news1','news2','news3','news4','news5','news6','news7','news8'); | |
$video_array = array('video1','video2','video3','video4','video5','video6','video7','video8'); | |
$photo_array = array('photo1','photo2','photo3','photo4','photo5','photo6','photo7','photo8','photo9','photo10','photo11','photo12','photo13'); | |
$asset_array = array($news_array, $video_array, $photo_array); | |
$type_count = sizeof($asset_array); | |
$pattern_count = sizeof($pattern) - 1; |
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
http://(.[^;,{}?&]+?).domain.com |
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 get_header(); ?> | |
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<h1><?php the_title() ?></h1> | |
<?php the_content() ?> | |
<?php endwhile; ?> | |
<?php get_footer(); ?> |
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 | |
header('Content-Type: text/html; charset=utf-8'); | |
function getAjax($url = false) { | |
if($url) { | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
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
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 200 hours" | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType application/javascript "access plus 1 week" | |
ExpiresByType text/javascript "access plus 1 week" | |
ExpiresByType application/x-shockwave-flash A3600 | |
<IfModule mod_headers.c> | |
Header append Cache-Control "public" | |
</IfModule> |
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 | |
require_once('../../../../wp-load.php'); | |
global $wpdb; | |
$wpdb->show_errors(); | |
$table_name = $wpdb->prefix . "arg_signups"; | |
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { | |
newsletter_install(); |
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 getAvgLuminance($filename, $num_samples=30) { | |
// needs a mimetype check | |
$img = imagecreatefromjpeg($filename); | |
$width = imagesx($img); | |
$height = imagesy($img); | |
$x_step = intval($width/$num_samples); | |
$y_step = intval($height/$num_samples); |
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 createLightbox(lightbox_content, lightbox_class) { | |
$('body').append('<div class="lightbox-wrap" ><div class="lightbox-position"><div class="lightbox ' + lightbox_class + '" /></div></div>'); | |
$lightbox = $('.lightbox'); | |
$lightbox_position = $('.lightbox-position'); | |
$lightbox_wrap = $('.lightbox-wrap'); | |
$lightbox_wrap.css({ | |
position : 'fixed', | |
left : 0, |
NewerOlder