View devtools_page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8" /> | |
<script src="devtools_page.js"></script> |
View background.worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Respond to CS | |
const startTime = Date.now() | |
const delay = 13000; | |
chrome.runtime.onMessage.addListener( (message, sender, respond) => { | |
setTimeout(respond, delay, Math.round((Date.now() - startTime + delay) / 1000)); | |
return true | |
}) | |
// Overlapping fetch requests | |
console.log('will req'); |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.reject(1).catch(err => { | |
if (err instanceof Error) { | |
throw err; // Exception | |
} | |
// Rejection | |
}).catch(exitProcess) |
View README.md
Created bookmarklet with http://ted.mielczarek.org/code/mozilla/bookmarklet.html
View README.md
work-cli
Personal launcher to start working in whatever directory you're into. Customize it as needed
$ work
# tries launching GitHub.app
# tries launching Sublime Text
# tries launching the build tool (npm run watch, gulp, grump in this order)
View bookmarklet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to be flattened with http://chriszarate.github.io/bookmarkleter/ | |
var s = document.createElement('script'); | |
s.onload = function () { | |
[].forEach.call(document.querySelectorAll('video'), makeVideoPlayableInline); | |
}; | |
s.src='https://rawgit.com/bfred-it/ffd71c642d2fcf4649b230bd71bc9a93/raw/fb39a59c458aeb49d882d81c9d4be2b3ae0b3b93/enabler.js'; | |
document.head.appendChild(s); |
View show-reddit-posts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create bookmarklet with: https://ted.mielczarek.org/code/mozilla/bookmarklet.html | |
var getPermalink = post => 'https://www.reddit.com'+post.data.permalink; | |
var getPermalinks = r => r.data.children.map(getPermalink); | |
var buildLink = url => { | |
var a = document.createElement('a'); | |
a.href = url; | |
a.textContent = url.match(/\/r\/[^/]+/) && url.match(/\/r\/[^/]+/)[0] || url; | |
a.style.display = 'block'; | |
return a; | |
}; |
View header.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//detecting tab key press | |
document.body.addEventListener('keydown', function detector (e) { | |
var keyCode = e.keyCode || e.which; | |
if(keyCode == 9) { | |
console.log( 'Tab detected' ); | |
document.documentElement.className += ' is-keyboarduser'; | |
document.body.removeEventListener('keydown', detector); |
NewerOlder