Skip to content

Instantly share code, notes, and snippets.

divinity76

Block or report user

Report or block divinity76

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@divinity76
divinity76 / php5_password_gen.php
Created Aug 31, 2019
php5-compatible php-based password generator page
View php5_password_gen.php
<?php
$max_password_length = 100;
?>
<form action="" method="POST">
password length: <input type="number" name="password_length" value="15" max="<?php echo $max_password_length;?>" /><br/>
uppercase: <input type="checkbox" name="uppercase" checked /><br/>
lowercase: <input type="checkbox" name="lowercase" checked /><br/>
numbers: <input type="checkbox" name="numbers" checked /><br/>
semi-indistinguishable characters (1Il oO0): <input type="checkbox" name="indistinguishable" unchecked /><br/>
<input type="submit" value="generate password">
View google spreadsheet api tests.php
<?php
declare(strict_types=1);
require_once('hhb_.inc.php');
require __DIR__ . '/vendor/autoload.php';
if (php_sapi_name() != 'cli') {
throw new Exception('This application must be run on the command line.');
}
/**
View file_duplicates.php
<?php
declare(strict_types=1);
$dir='C:\Users\hans\Downloads\penis\penis2\JYTTE';
if(!chdir($dir)){
die("ERROR: FAILED TO CHDIR");
}
$files_raw=glob("*",GLOB_NOSORT);
$files=array();
$duplicate_counter=0;
foreach($files_raw as $file){
View honningas_backup_cronjob.php
<?php
declare(strict_types=1);
require_once('hhb_.inc.php');
const RAR_FILENAME='backup.rar';
const RAR_FILEPATH=__DIR__.DIRECTORY_SEPARATOR.RAR_FILENAME;
const FTP_HOSTNAME="<censored>";
const FTP_USERNAME="<censored>";
const FTP_PASSWORD="<censored>";
const MYSQL_BACKUP_DIR=__DIR__.DIRECTORY_SEPARATOR.'mysql_backup_dir';
View online.net.total_bill.js
// execute on https://console.online.net/en/bill/list
(function(){
const rex=/^\s*(?<amount>\d+(?:\.\d+)?)\s*\€\s*$/;
// rex.exec(text).groups.amount
let total=0;
$("table:last >> tr:not(:first) > td:nth-child(5)").each(function(){
const plus=rex.exec(this.textContent).groups.amount;
console.log(plus);
total+=Number(plus);
});
View socat.sh
echo GET / | socat - OPENSSL:ratma.net:443,verify=0
@divinity76
divinity76 / uint8_fast_buffer.cpp
Last active Jul 27, 2019
fast uint8 buffer (faster than std::vector<uint8_t> )
View uint8_fast_buffer.cpp
// buffer which should be faster than std::vector<uint8_t> when resizing a lot because it does not do byte initialization when resizing
class uint8_fast_buffer
{
public:
uint8_fast_buffer(const size_t initial_size)
{
if(initial_size == 0)
{
// .. i don't really like the idea of buf being nullptr, this avoids that issue.
this->internal_reserve(1);
@divinity76
divinity76 / usb_badblocks.cpp
Last active Jul 1, 2019
highly optimized version of badblocks for testing USB memory sticks.
View usb_badblocks.cpp
#include <iostream>
#include <random>
#include <cassert>
#include <chrono>
#include <sstream>
#include <cstdint>
#include <climits>
#include <algorithm>
#include <functional>
#include <map>
View canvas_monitor.js
function beep(){
"use strict";
if(!beep.ele){
beep.ele=document.createElement("audio");
beep.ele.src="data:audio/mp3;base64,SUQzBAAAAAAJAVRQRTEAAAAbAAADU291bmRKYXkuY29tIFNvdW5kIEVmZmVjdHNURU5DAAAAFgAAAExBTUUgMy45OCAoTWF4IDAuOS4xKVRERU4AAAAUAAAAMjAxMS0wNS0yNFQxMToxMToyNlREVEcAAAAUAAAAMjAxMS0wNS0yNFQxMToxMToyNgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
View USB_badblocks.php
<?php
declare (strict_types = 1);
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
// INSTEAD USE https://gist.github.com/divinity76/605547aa19d244c5bd6016cc5d7f2402
You can’t perform that action at this time.