Skip to content

Instantly share code, notes, and snippets.

@rewmike
rewmike / form-contact.txt
Created October 21, 2016 21:17
BREW vs FESE
<form action="?submit" method="post">
<input type="hidden" name="contactform" value="true">
<input class="hidden" name="email" value="" autocomplete="off">
<input class="hidden" name="first_name" value="" autocomplete="off">
<input class="hidden" name="last_name" value="" autocomplete="off">
<div class="cols">
@rewmike
rewmike / input-script.es6
Last active July 28, 2016 14:39
Alert all the inputs
(() => {
const selector = 'input,textarea';
const excluded = ['checkbox', 'radio', 'hidden', 'submit', 'email', 'tel'];
const inputs = [...document.querySelectorAll(selector)];
inputs.forEach(input => {
const { name, type } = input;
if (name && name.length > 0 && excluded.indexOf(type) === -1) {
input.value = `<script> alert('${name}'); </script>`;
}
});
@rewmike
rewmike / Component-Component.js
Last active May 17, 2016 20:09
Common stuff
import sizePropType from '../propTypes/size';
import sizeClass from '../utils/sizeClass';
const Component = ({ size }) => {
let classNames = '';
if (size) classNames += ' ' + sizeClass(size);
return <div className={classNames} />;
};
Component.propTypes = {
@rewmike
rewmike / fftb.php
Last active October 5, 2015 22:07
fftb.php
<?php
// !!!
//die('FTTB');
// Set content type and disable encoding
header('Content-Type: text/html; charset=UTF-8');
//header('Transfer-Encoding: chunked');
header('Content-Encoding: none');
@rewmike
rewmike / novalidate-bookmarklet.js
Created October 24, 2013 22:13
Bookmarklet to disable HTML5 Form Validation
javascript:void((function(d){var f=d.forms,l=f.length,i=0;for(i;i<l;++i)f[i].setAttribute('novalidate',true)})(document));
@rewmike
rewmike / novalidate.js
Created October 24, 2013 22:09
Disable HTML5 Form Validation
(function (d) {
var f = d.forms, l = f.length, i = 0;
for (i; i < l; ++i) {
f[i].setAttribute('novalidate', true);
}
})(document);