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
utilCreateLightbox : function(new_options) { | |
options = { | |
box_class : '', | |
box_content : '', | |
wrap_css : { | |
position : 'fixed', | |
left : 0, | |
top : 0, | |
width : '100%', | |
height : '100%', |
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 | |
/* | |
* Resize images dynamically using wp built in functions | |
* Based on the script by Victor Teixeira | |
* - Updated to use wp_get_image_editor() | |
* - Moves resized files to uploadpath/resized/ | |
* Joe Swann | |
* | |
* php 5.2+ | |
* |
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
//First version | |
.pv(@p,@v) { | |
@{p}:@{v} | |
} | |
//Second version | |
.pv(@p,@v) { | |
-:~`";@{p}:@{v}".replace(/'/g,"")`; | |
// -:~`";@{p}:@{v}".replace(/'/g,"")`; | |
} |
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
.border-radius(@radius: 3px) { | |
border-radius: @radius; | |
-webkit-border-radius: @radius; | |
-moz-border-radius: @radius; | |
} | |
.text-shadow(@color: #fff) { | |
text-shadow: 1px 1px 1px @color; | |
filter: dropshadow(color=@color, offx=1, offy=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
@wrap: 740px; | |
@gutter: 20px; | |
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.gridMake(@gutter : @gutter) { |
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
.hList { | |
list-style:none; | |
margin:0; | |
padding:0; | |
li { | |
margin:0; | |
padding:0; | |
display:inline-block; | |
*display:inline; | |
} |
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
// Obviously {this} means replace with your version of this | |
// Dump DB | |
mysqldump -p -u {username} {dbname} > {dbname.sql} | |
// Tar DB | |
tar -cvf {dbname.tar} {dbname.sql} | |
// Move DB | |
curl -T {dbname.tar} ftp://{remote path}/{dbname.sql} --user {username}:{password} -v |
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 | |
// FTP login details | |
$ftp_server = 'yourserver.com'; | |
$ftp_server_path = '/public_html/'; | |
$ftp_user_name = 'username'; | |
$ftp_user_pass = 'password'; | |
// Connect to the FTP | |
$conn_id = ftp_connect($ftp_server); | |
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); |
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, |
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); |
OlderNewer