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
| yes | nohup cp -Rfav /home/sites/* /home/backup >> /tmp/cplog.log 2>&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 | |
| require("fpdf/fpdf.php"); | |
| require("fpdf/fpdi.php"); | |
| function is_pdf($file) { | |
| try { | |
| $pdf = new FPDI(); | |
| $pdf->setSourceFile($file); | |
| } catch(Exception $e) { | |
| return false; |
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
| <FilesMatch "\.(?i:php|js)$"> | |
| Order allow,deny | |
| Deny from all | |
| </FilesMatch> |
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/sh | |
| find . -type f -name '*.php' -not -path "*/dev/*" -not -path "*/tickets/*" -not -path "*/admin/*" -not -path "*/includes/*" -not -path "*/vendor/*" | xargs egrep -n -i "(fwrite|move_uploaded_file|file_put_contents|fputs|fputcsv) *\(" |
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/sh | |
| ( ( (git diff --name-only origin/master $GIT_COMMIT ) | grep .php$ ) | xargs -n1 echo php -l | bash ) | grep -v "No syntax errors detected" && echo "PHP Syntax error(s) detected" |
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 | |
| function fix_special_links($text) { | |
| $fixed = $text; | |
| $fixed = str_replace("/><br />", "/> <br>", $fixed); | |
| $fixed = str_replace("/><br>", "/> <br>", $fixed); | |
| $fixed = preg_replace("#\<http:\/\/(.*)(\/\>)+#i", "(http://$1)", $fixed); | |
| $fixed = preg_replace("#\<https:\/\/(.*)(\/\>)+#i", "(https://$1)", $fixed); | |
| return $fixed; | |
| } |
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
| docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher | |
| docker run -d -p 1081:1080 -p 1026:1025 --name mailcatcher2 schickling/mailcatcher |
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 | |
| $timestamp='2019-05-16 07:56:00'; | |
| $format="Y-m-d H:i:s"; | |
| $from_timezone='Asia/Manila'; | |
| $to_timezone='America/Chicago'; | |
| $source_timezone = new DateTimeZone($from_timezone); | |
| $destination_timezone = new DateTimeZone($to_timezone); | |
| $datetime = new DateTime($timestamp, $source_timezone); | |
| var_dump($datetime); | |
| $offset = $destination_timezone->getOffset($datetime); |
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 | |
| $str = "<a>bing.com</a>"; | |
| echo preg_replace('#<a.*?>([^>]*)</a>#i', '$1', $str) |
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
| $(".LMgvRb").each(function(i, x){ var sql="INSERT INTO timezone (location, tz) VALUES ('" + $(x).attr("aria-label") + "','" + $(x).attr("data-value") + "')" }); |
NewerOlder