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
<a href="javascript:var f%3Ddocument.getElementsByTagName(%27form%27)%3Bfor (var i%3D0%3B i<f.length%3Bi%2B%2B)%7Bf%5Bi%5D.setAttribute(%27novalidate%27,%27novalidate%27)%3B%7D">HTML5 novalidate</a> |
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 | |
// Error reporting | |
error_reporting(E_ALL); | |
ini_set('display_errors', true); | |
// Return the Apache user | |
$tmpFilename = tempnam('/tmp', 'TEST'); | |
$handle = fopen($tmpFilename, 'w'); | |
fwrite($handle, 'testdata'); | |
fclose($handle); |
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 | |
/** | |
* Studio 24 Application | |
* | |
* @category Studio 24 | |
* @package S24_Application | |
* @copyright Copyright (c) 2009-2010 Studio 24 Ltd (www.studio24.net) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
* @author Simon R Jones <[email protected]> | |
* @version 1.1 |
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 | |
// Read CSV file | |
// PHP5.4+ | |
ini_set('auto_detect_line_endings', true); | |
$file = new SplFileObject("path/to/file.csv"); | |
$file->setFlags(SplFileObject::READ_CSV); | |
$line = 0; | |
$headers = []; | |
foreach ($file as $row) { |
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
// Go back link functionality | |
// Requires HTML link with id="back-to-last-page" which is hidden by default with display: none; | |
if (window.history && window.history.pushState) { | |
// Only display if referrer matches current hostname | |
var matchHostname = new RegExp('http(s)?:\/\/' + window.location.host); | |
if (matchHostname.test(document.referrer)) { | |
// Show link and go back via History API |
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 | |
// Clean PHP session files when you have 10,000s of them! | |
// Set this to the folder that contains your session files with trailing slash | |
// @see http://php.net/manual/en/function.session-save-path.php | |
$sessionTmpFolder = '/path/to/tmp/'; | |
$x=0; | |
foreach (range(0,9) as $number) { | |
foreach (range('a','z') as $letter) { |
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
# Find all Apache-owned PHP files | |
find /var/www -user apache -type f -name '*.php' > suspicious_files.txt | |
# Find all non-binary files owned by Apache that are not named .php but contain PHP parser tags | |
find /var/www -user apache -type f -not -name '*.php' | xargs egrep -ilI "(<\?php|<\?=|<\? *(?!(xml)))" > suspicious_files2.txt | |
# Find all files containing PHP parser tags in global tmp folder | |
egrep -ilIr "(<\?php|<\?=|<\? *(?!(xml)))" /tmp > suspicious_files3.txt | |
# You can inspect all the PHP files for certain strings to find potentially dodgy code. Yes, they often contain the word hack! |
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 | |
# Copyright 2013 Percona LLC and/or its affiliates | |
# @see https://www.percona.com/blog/2013/12/24/renaming-database-schema-mysql/ | |
set -e | |
if [ -z "$3" ]; then | |
echo "rename_db <server> <database> <new_database>" | |
exit 1 | |
fi | |
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss` | |
if [ -n "$db_exists" ]; then |
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 | |
# Copyright 2013 Percona LLC and/or its affiliates | |
# @see https://www.percona.com/blog/2013/12/24/renaming-database-schema-mysql/ | |
set -e | |
if [ -z "$3" ]; then | |
echo "rename_db <server> <database> <new_database>" | |
exit 1 | |
fi | |
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss` | |
if [ -n "$db_exists" ]; then |
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
<h1 data-wp-block="h1">My title</h1> | |
<p data-wp-block="p">Some text</p> | |
<div data-wp-block="custom-collapsable" class="faqs-component"> | |
<ul class="accordion"> | |
<li data-wp-block-item="1" class="accordion-navigation active"> | |
<a data-wp-block-field="title" aria-expanded="true" href="#panel691">My FAQ question title here</a> | |
<div data-wp-block-field="contents" id="panel691" class="content active"> | |
<ul> |
OlderNewer