Skip to content

Instantly share code, notes, and snippets.

View lgarron's full-sized avatar
💭
😼

Lucas Garron lgarron

💭
😼
View GitHub Profile
@lgarron
lgarron / index.md
Created February 4, 2019 22:58
Example Solves
@lgarron
lgarron / console.log.cpp
Last active May 31, 2019 09:40
Trolling C++ using console.log
/* Vararg code by Daniel Cheng (@zetafunction) */
#include <iostream>
#include <utility>
struct {
template<typename T>
static void log(T&& t) {
std::cout << t << "\n";
}
@lgarron
lgarron / domain-name.html
Created December 22, 2020 00:03
<domain-name>
<!DOCTYPE html>
<html>
<script type="module">
class DomainNameElement extends HTMLElement {
connectedCallback() {
this.textContent = (new URL(location.href)).hostname
}
}
customElements.define('domain-name', DomainNameElement);
</script>
-----BEGIN CERTIFICATE REQUEST-----
MIIC9DCCAdwCAQAwbjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWEx
FjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNTTDEhMB8GA1UE
AwwYeG4tLW4xYWFlN2Y3by5iYWRzc2wuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAwgTs+IzuBMKz2FDVcFjMkxjrXKhoSbAitfmVnrErLHY+bMBL
YExM6rK0wA+AtrD5csmGAvlcQV0TK39xxEu86ZQuUDemZxxhjPZBQsVG0xaHJ590
6wqdEVImIXNshEx5VeTRa+gGPUgVUq2zKNuq/27/YJVKd2s58STRMbbdTcDE/FO5
bUKttXz+rvUV0jNI5yJxx8IUemwo6jdK3+pstXK0flqiFtxpsVdE2woSq97DD0d0
XEEi4Zr5G5PmrSIGKS6xukkcDCeeo/uL90ByAKySCNmMV4RTgQXL5v5rVJhAJ4XH
ELtzcO9pGEEHRVV8+WQ/PSzDqXzrkxpMhtHKhQIDAQABoEEwPwYJKoZIhvcNAQkO
-----BEGIN CERTIFICATE REQUEST-----
MIIC1zCCAb8CAQAwUDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGl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Rq9F4V1I1htqzlkaZHQD9ug3InEEBWAt9Mr8+qTGRAmxBiMLHBciXUlhD
#!/usr/bin/env bash
# Setup script for a checkout of the Chromium HSTS preload list.
# Source -> medium.com/p/8c8896f5cef3 and gist.github.com/hemanth/7611535
echo "---- Creating folder and initializing a git repository. ----"
mkdir chromium-hsts && cd chromium-hsts
git init
echo "---- Adding chromium remote and initializing sparse checkout of /net/http. ----"
git remote add origin https://chromium.googlesource.com/chromium/src
@lgarron
lgarron / script.js
Last active August 15, 2023 14:47
WCA Live WPA/BPA
globalThis.addedElems ??= [];
for (const elem of globalThis.addedElems) {
elem.remove();
}
globalThis.addedElems = [];
function registerElem(elem) {
elem.className = "MuiTableCell-root MuiTableCell-body MuiTableCell-alignRight MuiTableCell-sizeSmall css-wrjkbz";
globalThis.addedElems.push(elem);
return elem;
}
@lgarron
lgarron / copyToClipboard.html
Last active December 20, 2023 12:53
Simple `navigator.clipboard.writeText()` polyfill.
<script>
// A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers.
// Note that:
// - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020.
// - In Edge, this may call `resolve()` even if copying failed.
// - In Safari, this may fail if there is nothing selected on the page.
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution.
//
// License for this Gist: public domain / Unlicense
function writeText(str) {