Skip to content

Instantly share code, notes, and snippets.

Zack Douglas zackdouglas

Block or report user

Report or block zackdouglas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
zackdouglas / Lazy or short switch.js
Created Mar 28, 2018
A silly switch transpilation target
View Lazy or short switch.js
(f={f () { return 'f' }, g () { return 'g' }}['f'],f&&f()||new Error)
View jsTemplatedQuine.js
var expose=(strings,...expressions)=>{return{strings,expressions}};
JSON.stringify((expose`var ${expose(`expose=${expose}`)};`),undefined,2);
zackdouglas / detectPrivateMode.js
Created May 19, 2017
Detect if a user is in Private Browsing mode
View detectPrivateMode.js
function detectPrivateMode(a){var b;if(window.webkitRequestFileSystem)window.webkitRequestFileSystem(window.TEMPORARY,1,function(){b=!1},function(a){b=!0});else if(window.indexedDB&&/Firefox/.test(window.navigator.userAgent)){var c;try{"test")}catch(a){b=!0}void 0===b&&t(function(){return"done"===c.readyState},function(a){a||(b=!c.result)})}else if(o(window.navigator.userAgent)){b=!1;try{window.indexedDB||(b=!0)}catch(a){b=!0}}else if(window.localStorage&&/Safari/.test(window.navigator.userAgent)){if(window.safariIncognito)b=!0;else try{window.localStorage.setItem("test",1)}catch(a){b=!0}void 0===b&&(b=!1,window.localStorage.removeItem("test"))}t(function(){return void 0!==b},function(c){a(b)})}
zackdouglas /
Last active May 25, 2017
Universal JS atou/utoa


A better btoa and atob that supports non-ASCII characters in a healthy manner.

Compatible with AMD, CommonJS, and ES2015 module loaders.

zackdouglas / css-content-attr-fails.html
Created Feb 9, 2017
Why does CSS attr() fail for input elements?
View css-content-attr-fails.html
body *:before {
content: attr(value) ' '
<div value=works />
zackdouglas /
Last active Jan 27, 2017
Make any page look like-ish Markdown
zackdouglas / launchWorker.js
Created Jan 17, 2017
Launch a function as a Worker
View launchWorker.js
function launchWorker(f) {
if (! (f instanceof Function)) {
throw new Error(`Cannot launch ${typeof(f)} as Worker`);
const src = `(${f})();`;
const blob = new Blob([src], {type: 'application/javascript'});
const url = URL.createObjectURL(blob);
return new Worker(url);
zackdouglas / template.html
Created Sep 9, 2015
Click to peek password entry field
View template.html
<input type=password placeholder=Password onmousedown="this.type=''" onmouseup="this.type='password'" style="padding:1px"/>
zackdouglas /
Last active Sep 9, 2015

The Latest on Stagefright: CVE-2015-1538 Exploit is Now Available for Testing Purposes

By zLabs Wednesday, Sep 9 2015 at 08:05

37 465

8  7  585

More than a month has passed since Zimperium first broke the news of zLabs’ VP of Platform Research and Exploitation Joshua J. Drake’s discovery of multiple critical vulnerabilities in Android’s media library – libstagefright. In that time frame, the number and importance of the events that have unfolded is nothing short of amazing. Back in April and May we reported two sets of vulnerabilities to Google, both including multiple with critical severity. In July, we announced our intentions to publish our exploit on August 5th during Black Hat USA. After discussions with ZHA Partners, including both carriers and device manufacturers, we agreed to postpone the release of the exploit until August 24th. Multiple researchers have publicly discussed their own working exploits targeting vulnerabilities within libstagefright. Before we dive into our exploit, let’s rec

zackdouglas / test
Created Apr 26, 2015
Newline Diff Example
View test
This line will not be included in the diff in the next revision.
This line will be included in the diff in the next revision.
This line was added in the new revision.
You can’t perform that action at this time.