Skip to content

Instantly share code, notes, and snippets.

View devgaucho's full-sized avatar

Gaucho devgaucho

View GitHub Profile
@gboncoffee
gboncoffee / html.h
Last active December 6, 2023 03:05
Macros to generate HTML with the C preprocessor
#ifndef __HTML_MACROS
#define __HTML_MACROS
#define HTML(l, head, body) <!DOCTYPE html> \
<html lang=#l> \
head \
body \
</html>
#define HEAD(...) <head> \
@hbisneto
hbisneto / AssocArray.php
Last active September 1, 2023 17:04
AssocArray.php
<?php
$arrayAssociativo = array(
"nome" => "João",
"idade" => 30,
"cidade" => "São Paulo"
);
$json = json_encode($arrayAssociativo);
?>
@erikdubbelboer
erikdubbelboer / collisions.txt
Created October 25, 2019 18:37
Hash collision demos
# collision inputs taken from https://www.mscs.dal.ca/~selinger/md5collision/
# As you can see they produce the same MD5 hash
$ echo -n 'd131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70' | xxd -r -p | md5
79054025255fb1a26e4bc422aef54eb4
$ echo -n 'd131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd436c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec69821bcb6a8839396f965ab6ff72a70' | xxd -r -p | md5
79054025255fb1a26e4bc422aef54eb4
# Now add 01 to the end of both of them.
# The hash will be different from above but they will still produce a collision.
$ echo -n 'd131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf2
@christiangenco
christiangenco / download website assets
Created January 20, 2014 23:23
Use wget to download a website's assets, including images, css, javascript, and html. From http://www.linuxjournal.com/content/downloading-entire-web-site-wget
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/