Skip to content

Instantly share code, notes, and snippets.

View larchanka's full-sized avatar
🥷
On duty

Mikhail Larchanka larchanka

🥷
On duty
View GitHub Profile
@Explosion-Scratch
Explosion-Scratch / Compress string.js
Created November 1, 2021 18:51
Compress string using gzip and native browser APIs
function compress(string, encoding) {
const byteArray = new TextEncoder().encode(string);
const cs = new CompressionStream(encoding);
const writer = cs.writable.getWriter();
writer.write(byteArray);
writer.close();
return new Response(cs.readable).arrayBuffer();
}
function decompress(byteArray, encoding) {
@james2doyle
james2doyle / sqlite-api.php
Created May 12, 2019 21:27
Turn Sqlite into a public, read-only, JSON API
<?php
function json_response(int $code = 200, array $data = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header('Cache-Control: public, max-age=300');
@mgeeky
mgeeky / xml-attacks.md
Last active October 27, 2025 18:13
XML Vulnerabilities and Attacks cheatsheet

XML Vulnerabilities

XML processing modules may be not secure against maliciously constructed data. An attacker could abuse XML features to carry out denial of service attacks, access logical files, generate network connections to other machines, or circumvent firewalls.

The penetration tester running XML tests against application will have to determine which XML parser is in use, and then to what kinds of below listed attacks that parser will be vulnerable.


@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 16, 2025 11:36
A badass list of frontend development resources I collected over time.