Skip to content

Instantly share code, notes, and snippets.

@krk
krk / 0001-assumeClosuresOnlyCaptureReferences.patch
Created December 31, 2021 01:36
google-closure PureScript optimize via `assumeClosuresOnlyCaptureReferences`
diff --git a/src/com/google/javascript/jscomp/CompilationLevel.java b/src/com/google/javascript/jscomp/CompilationLevel.java
index 02ec99aee..0211a6cc1 100644
--- a/src/com/google/javascript/jscomp/CompilationLevel.java
+++ b/src/com/google/javascript/jscomp/CompilationLevel.java
@@ -181,7 +181,7 @@ public enum CompilationLevel {
options.setSmartNameRemoval(true);
options.setInlineConstantVars(true);
options.setInlineFunctions(Reach.ALL);
- options.setAssumeClosuresOnlyCaptureReferences(false);
+ options.setAssumeClosuresOnlyCaptureReferences(true);
// As seen in https://twitter.com/XssPayloads/status/1297794089220546560
( [,ᅠ︀,,,,ᅠ︁] = [ ] + { } ,[ᅠ︂,ᅠ︃,ᅠ︄,ᅠ︅,,ᅠ︆,ᅠ︇,ᅠ︈,,,ᅠ︉] =[ !!ᅠ︀] + !ᅠ︀+ᅠ︀.ᅠ︀)[ᅠ︁+=ᅠ︀+ᅠ︉+ᅠ︈+ᅠ︂+ᅠ︃+ᅠ︄+ᅠ︁+ᅠ︂+ᅠ︀+ᅠ︃][ᅠ︁](ᅠ︆+ᅠ︇+ᅠ︅+ᅠ︃+ᅠ︂+ '`🙈`' )``
// For the above input, google closure compiler can be massaged to produce:
var $jscomp = $jscomp || {};
$jscomp.scope = {};
$jscomp.createTemplateTagFirstArg = function(c) {
return c.raw = c;
This file has been truncated, but you can view the full file.
XXX\rustlang\rust [48.1GB]
[ 316KB] RELEASES.md
[ 32KB] CONTRIBUTING.md
[ 20KB] config.toml.example
[ 20KB] config.toml
[ 16KB] .travis.yml
[ 16KB] .mailmap
[ 12KB] README.md
@krk
krk / Colorized Slack.user.js
Last active March 1, 2018 12:03 — forked from aricih/Colorized Slack.user.js
Colorized Slack Threads and more
// ==UserScript==
// @name Colorized Slack
// @namespace https://www.netsparker.com/
// @version 1.0
// @description Colorizes the message threads.
// @author Hakan Arıcı
// @include *.slack.com*
// ==/UserScript==
//////////////////////////////////////// CONFIGURATION ////////////////////////////////////////
0:000> kvn
# ChildEBP RetAddr Args to Child
00 0019b240 75df8839 000009c0 00000000 00000000 ntdll!NtWaitForSingleObject+0xc (FPO: [3,0,0])
01 0019b2b4 75df8792 000009c0 ffffffff 00000000 KERNELBASE!WaitForSingleObjectEx+0x99 (FPO: [SEH])
02 0019b2c8 53508071 000009c0 ffffffff ffffffff KERNELBASE!WaitForSingleObject+0x12 (FPO: [Non-Fpo])
03 0019b2e8 531a7216 2bca6900 00000001 2bca6900 mshtml!`CBackgroundInfo::Property<CBackgroundImage>'::`7'::`dynamic atexit destructor for 'fieldDefaultValue''+0x4b21
04 0019b2f8 531a70c0 00000000 5319f057 ffffffff mshtml!CHtmPre::Disable+0x2a (FPO: [0,0,0])
05 0019b300 5319f057 ffffffff 00000000 2bca6000 mshtml!CHtmLoad::ShutdownPreParser+0x23 (FPO: [0,0,4])
06 0019b318 5319f8c7 00000000 2bc74fa0 00000000 mshtml!CHtmLoad::Passivate+0x17 (FPO: [Non-Fpo])
07 0019b330 5319f4a3 00000000 00000000 2bc39400 mshtml!CBaseFT::Release+0x147 (FPO: [Non-Fpo])
@krk
krk / mshtml.dll-11.0.14393.321.log
Created October 25, 2016 07:59
CPU hog in mshtml!CHtmPre::ScanForTagUsingSecondScanAttributeLogic ?
0:035> kvn
# ChildEBP RetAddr Args to Child
00 2bfbf724 59da3591 2bfbf7a0 2bfbf7a8 00000000 mshtml!CHtmPre::ParseLineFeed+0x5 (FPO: [Non-Fpo])
01 2bfbf744 59b2b4e3 2bfbf7a0 2bfbf7a8 315df08a mshtml!CHtmPre::ScanForTagUsingSecondScanAttributeLogic+0x12e (FPO: [Non-Fpo])
02 2bfbf7b0 597e2e50 00010000 2bc06900 2bb78480 mshtml!`TextInput::TextInputLogging::Instance'::`2'::`dynamic atexit destructor for 'wrapper''+0x9edb3
03 2bfbf7d8 5985cee2 2bc06900 00000000 2bb78480 mshtml!CHtmPre::Exec+0x1f0 (FPO: [Non-Fpo])
04 2bfbf804 5985c8f4 2bfbf828 5985c770 2bb78480 mshtml!CHtmPre::Run+0x92 (FPO: [0,5,4])
05 2bfbf820 5985f72d 5985f6c0 5985f6c0 2bb78480 mshtml!CDwnTaskExec::ThreadExec+0x184 (FPO: [Non-Fpo])
06 2bfbf838 745562c4 2bb78480 745562a0 931f6730 mshtml!CExecFT::StaticThreadProc+0x6d (FPO: [Non-Fpo])
07 2bfbf84c 76f30609 2bb78480 8182d0a1 00000000 kernel32!BaseThreadInitThunk+0x24 (FPO: [Non-Fpo])

Keybase proof

I hereby claim:

  • I am krk on github.
  • I am kerem (https://keybase.io/kerem) on keybase.
  • I have a public key ASBZMbUVYEmgW1nJtOmyNKJm5OKYyZ5fJFUtd62bmAC8nwo

To claim this, I am signing this object:

private void ReadCustomMetadata(BitAccess bits) {
int savedPosition = bits.Position;
byte version;
bits.ReadUInt8(out version);
if (version != 4) {
throw new PdbDebugException("Unknown custom metadata item version: {0}", version);
}
byte kind;
bits.ReadUInt8(out kind);
bits.Align(4);
@krk
krk / ProfiledDbProviderFactoryAlwaysProfiled.cs
Created June 3, 2014 08:18
MiniProfiler DbDataAdapter DbCommand type mismatch exception workaround
public class ProfiledDbProviderFactoryAlwaysProfiled : ProfiledDbProviderFactory
{
private readonly DbProviderFactory _tail;
public ProfiledDbProviderFactoryAlwaysProfiled(DbProviderFactory tail)
: base(tail)
{
_tail = tail;
}