Skip to content

Instantly share code, notes, and snippets.

View mgol's full-sized avatar

Michał Gołębiowski-Owczarek mgol

View GitHub Profile
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
#!/usr/bin/node
const N = 1000000;
// 130 ms
(function() {
console.time('+=');
let a = '';
for (let i = 0; i < N; i++) {
a += 'x';
@samthor
samthor / safari-nomodule.js
Last active April 26, 2025 20:41
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:

Tree-shakeable Tokens Docs

Status quo and issues with it

Injector structure

Currently, to provide services in Angular, you include them in an @NgModule:

@Injectable()

Multiple vulnerabilities in jQuery Mobile

Summary

All current versions of jQuery Mobile (JQM) as of 2019-05-04 are vulnerable to DOM-based Cross-Site Scripting (XSS) via crafted URLs. In JQM versions up to and including 1.2.1, the only requirement is that the library is included in a web application. In versions > 1.2.1, the web application must also contain a server-side API that reflects back user input as part of an HTTP response of any type. Practically all non-trivial web applications contain at least one such API.

Additionally, all current versions of JQM contain a broken implementation of a URL parser, which can lead to security issues in affected applications.

@duskwuff
duskwuff / dictionary.bin
Last active January 23, 2025 22:42
Contents of the Brotli dictionary (JSON encoded)
"time"
"down"
"life"
"left"
"back"
"code"
"data"
"show"
"only"
"site"