This file contains hidden or 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
ab -n 25 -c 5 http://mikerogers.io |
This file contains hidden or 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
// The function that scales an images with canvas then runs a callback. | |
function scaleImage(url, width, height, liElm, callback){ | |
var img = new Image(), | |
width = width, | |
height = height, | |
callback; | |
// When the images is loaded, resize it in canvas. | |
img.onload = function(){ | |
var canvas = document.createElement("canvas"), |
This file contains hidden or 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
$('form.fileEdit input[type="submit"]').on('click', function(e) { | |
e.preventDefault(); | |
var _$thisElem = $(this); | |
$.getJSON(ADMIN_URL+'filemanager/editfile', | |
_$thisElem.parent('form').serialize(), | |
function(data) { | |
alert(data); | |
getFiles({clearout:true}); | |
} | |
); |
This file contains hidden or 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
<ul class="slides"> | |
<li> | |
<?php | |
$count = 0; | |
query_posts('post_type=testimonials&posts_per_page=-1'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<h3> | |
<?php the_post_thumbnail(); ?> | |
<?php the_title();?> | |
<span><?php the_field('job_position'); ?></span> | |
</h3> |
This file contains hidden or 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
#!/bin/bash | |
## Email Variables | |
EMAILDATE=`date --date="today" +%y-%m-%d` | |
EMAIL="[email protected]" | |
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE | |
EMAILMESSAGE="/tmp/emailmessage1.txt" | |
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE | |
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE |
This file contains hidden or 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 | |
/** | |
* Usage: | |
* Send the url you want to access url encoded in the url paramater, for example (This is with JS): | |
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2') | |
*/ | |
// The tokens, keys and secrets from the app you created at https://dev.twitter.com/apps | |
$config = array( |
This file contains hidden or 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
document.getElementById('itemName').innerHTML = '<font size="8">' + response + '</font> <button onclick="itemNameAllowEdit("' + response + '");">Edit</button>'; |
This file contains hidden or 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
$query = ' | |
CREATE TABLE products ( | |
product_id int not null auto_increment PRIMARY KEY, | |
product_name varchar(100), | |
description varchar(200), | |
photo_url varchar(100), | |
price decimal(4,2), | |
stock_level decimal(3,0) | |
); | |
'; |
This file contains hidden or 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 doSomething(xhr) { | |
var test = xhr.responseText + 'was found'; | |
alert(test); | |
} | |
function ajaxReturn (file,func,data) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST",file, false); // Adding in the false, means send will wait for a reply until continuing with the code. | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
This file contains hidden or 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
127.0.0.1 localhost site-name.local |