Skip to content

Instantly share code, notes, and snippets.

@davatron5000
Last active February 3, 2021 19:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davatron5000/9db6a622a6f2203ec1f900512d6fae86 to your computer and use it in GitHub Desktop.
Save davatron5000/9db6a622a6f2203ec1f900512d6fae86 to your computer and use it in GitHub Desktop.
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'
}
})
@davatron5000
Copy link
Author

@jimniels Major upgrades! Lot more readable now.

@CITguy
Copy link

CITguy commented Feb 3, 2021

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