Last active
February 3, 2021 19:38
-
-
Save davatron5000/9db6a622a6f2203ec1f900512d6fae86 to your computer and use it in GitHub Desktop.
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
document.querySelectorAll('.Box-row .js-navigation-open').forEach( (item) => { | |
const filename = item.textContent.toLowerCase(); | |
const humanFiles = ['AUTHORS', 'CHANGELOG', 'CODE_OF_CONDUCT', 'CONTRIBUTING', 'LICENSE', 'README', 'TECHNOLOGY', 'TROUBLESHOOTING', 'SECURITY']; | |
const row = item.parentNode.parentNode.parentNode; | |
if((filename != 'src' && filename.endsWith('rc')) | |
|| filename.includes('config') | |
|| filename.includes('ignore') | |
|| filename.includes('.conf.js') | |
|| filename.includes('webpack') | |
|| filename == 'robots.txt' | |
|| filename == 'sitemap.xml' | |
|| filename == 'cname' | |
|| filename.endsWith('.toml') | |
|| filename.endsWith('.json') | |
|| filename.endsWith('.json5') | |
|| filename.endsWith('.yml') | |
|| filename.endsWith('.yaml') | |
|| filename.endsWith('.lock') | |
|| filename.endsWith('-lock.json') | |
|| filename.endsWith('.bazel') | |
|| filename.startsWith('gemfile') | |
|| filename.startsWith('gruntfile') | |
|| filename.startsWith('gulpfile') | |
|| filename.startsWith('.') | |
){ | |
row.style.background = '#fee9e8' | |
} else if(humanFiles.includes(item.textContent.split('-')[0].split('.')[0])) { | |
row.style.background = '#edf6fd' | |
} | |
}) |
So is this gist for humans or robots? 😉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jimniels Major upgrades! Lot more readable now.