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 | |
/** | |
* RITORNA L'URL CORRENTE | |
*/ | |
function curPageURL() { | |
$pageURL = 'http'; | |
if ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") $pageURL .= "s"; | |
$pageURL .= "://"; | |
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; |
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
jQuery('iframe.inpagedemo').load(function () { | |
var iframe = jQuery(this); | |
jQuery(window).resize(function() { | |
iframe.height(iframe[0].contentWindow.document.body.scrollHeight + 40); | |
}); | |
jQuery(window).trigger('resize'); | |
}); |
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 | |
// ADD NEW ADMIN USER TO WORDPRESS | |
// ---------------------------------- | |
// Put this file in your Wordpress root directory and run it from your browser. | |
// Delete it when you're done. | |
require_once('wp-blog-header.php'); | |
require_once('wp-includes/registration.php'); | |
// CONFIG |
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
<form method="post" id="tiribi" enctype="multipart/form-data"> | |
<input id="fileuploader" type="file" name="file[]" multiple="" > | |
<ul class="filelist"></ul> | |
<input type="submit" class="button" name="multi_post_submit" value="Upload files" id="submit_button" /> | |
</form> |
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 | |
/** | |
* WordPress Gists Shortcode | |
* | |
* To include a Gist you have different possibilities: | |
* [gists id="5964192"] | |
* [gists]https://gist.github.com/micc83/5964192[/gists] | |
* [gists id="5964192" file="index.html"] | |
* [gists file="index.html"]https://gist.github.com/micc83/5964192[/gists] |
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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^(.*) /conf/index.html [NC,L] |
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 | |
/** | |
* Assert the response content match a previous taken snapshot. | |
* If the snapshot doesn't exists on the first run it gets | |
* created and the test is marked as incomplete. | |
*/ | |
private function seeSnapshot() | |
{ | |
$testName = debug_backtrace()[1]['function']; | |
$filename = "snapshots/{$testName}.json"; |
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
# Create file maintenance.html then | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC] | |
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] | |
RewriteRule .* /maintenance.html [R=302,L] | |
</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
botch() { | |
while true; do | |
(echo -en '\033[H' | |
CMD="$@" | |
bash -c "$CMD" | while read LINE; do | |
echo -n "$LINE" | |
echo -e '\033[0K' | |
done | |
echo -en '\033[J') | tail -r | tail -r | |
sleep 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
alias ld-up="(cd laradock;docker-compose up -d apache2 mariadb)" | |
alias ld-down="(cd laradock;docker-compose down)" | |
alias ld-ssh="(cd laradock;docker-compose exec workspace bash)" |