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
#!/bin/bash | |
# Exit script if a command fails | |
set -e | |
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
# Setup Stuff, only needs to be run once | |
# Aftwards you can just run the stuff under deploy | |
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
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 | |
/** | |
* PHP Script to replace most `array_push` command usage | |
* in a project with index notation `$array[] = $item` | |
* due to speed improvements https://stackoverflow.com/a/559859 | |
*/ | |
function rsearch($folder, $pattern) { | |
$dir = new RecursiveDirectoryIterator($folder); | |
$ite = new RecursiveIteratorIterator($dir); |
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
# Overview | git log --pretty=format:"%H | %ad | %s" --author="Sam James" | |
#for d in "~/Documents/Git Projects"; | |
for d in ~/Desktop/*/; | |
do | |
if [ -d "$d.git" ]; then | |
echo " Git Project - $d"; | |
echo "$d" >> git.log.tmp; | |
git --git-dir="$d.git" log --pretty=format:"%H | %ad | %s" --author="Sam James" >> git.log.tmp; | |
echo "\n" >> git.log.tmp; |
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 | |
// Very large dataset (1762397 Lines|100 MB) so probally going to exhaust the set limit | |
ini_set("memory_limit", "-1"); | |
// Download the file | |
$file_name = 'postcodes.zip'; | |
$dataset_url = 'https://www.freemaptools.com/download/full-postcodes/ukpostcodes.zip'; | |
file_put_contents($file_name, file_get_contents($dataset_url)); |
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
#!/bin/sh | |
# Install Instructions | |
# Add this file somewhere on the server(Users Home or Scripts dir would be a good place) | |
# Make is executable `chmod +x diskalert.sh` | |
# Add to crontab | |
# - Edit Crontab `crontab -e` | |
# - Add new line (Replacing cron expr and path) `0 */3 * * * /scripts/diskalert.sh` | |
# - Save: (ESC, Colon, w, q, enter) | |
# |
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 | |
session_start(); | |
var_dump(session_id()); | |
echo '<br>'; | |
echo '<pre>'; | |
print_r($_SESSION); | |
echo '</pre>'; | |
?> | |
<hr> | |
<a href="login.php"><button>Login</button></a> |
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
diff --git a/lib/internal/Magento/Framework/Mail/Message.php b/lib/internal/Magento/Framework/Mail/Message.php | |
index c8f0e75c5280..96566ad82b8e 100644 | |
--- a/lib/internal/Magento/Framework/Mail/Message.php | |
+++ b/lib/internal/Magento/Framework/Mail/Message.php | |
@@ -89,10 +89,23 @@ public function getBody() | |
/** | |
* @inheritdoc | |
+ * | |
+ * @deprecated This function is missing the from name. The |
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
<video><a href="javascript:alert(5);">a</a></video> | |
<p><p><audio><audio src=x onerror=alert(4)> | |
<p><html><audio><br /><audio src=x onerror=alert(3)></p> | |
<video><img src="x" onload="alert(1)"></video> | |
<p><audio><img src="javascript:alert(2)"></audio> | |
<img src=x onerror="javascript:alert('XSS')"> | |
<IMG SRC='jav ascript:alert(`6`);'> | |
<img src=x onerror="javascript:alert('7')"> |
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
//*********** | |
// USAGE | |
//*********** | |
var string = String.random(8); | |
//*********** | |
// UGLIFIED | |
//*********** | |
String.prototype.constructor.random=function(r){let t,n,o="";for(;r>0;)n=r>5?5:r,o+=t=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,n),r-=n;return o}; |
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
//******** | |
//USAGE | |
//******** | |
rangeFromAge(19); | |
//******** | |
//UGLIFIED | |
//******** | |
const rangeFromAge=e=>{let t=new Date;t.setFullYear(t.getFullYear()-e);let l=new Date(t);return l.setFullYear(l.getFullYear()-1),{earliest:Youngest,latest:Oldest}}; |