Skip to content

Instantly share code, notes, and snippets.

@rowaasr13
Last active January 21, 2021 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rowaasr13/d272904099edd9346a1d8f76b8a77631 to your computer and use it in GitHub Desktop.
Save rowaasr13/d272904099edd9346a1d8f76b8a77631 to your computer and use it in GitHub Desktop.
text_extensions.pl - Generates list of patterns for highly compressible files.
# Generates list of patterns for highly compressible files.
# Most of them are text and formatted text - hence name.
# But some are other uncompressed formats - bitmaps, targa, uncompressed sounds, textures, etc.
use strict;
use warnings;
my @ext;
my %known;
foreach(split /[\r\n]/, '
*.txt
*.log
*.ini
*.inf
*.conf
*.csv
*.tsv
*.md
*.rtf
*.xml
*.srt
*.ass
*.ssa
*.etl
*.mum
*.manifest
*.htm
*.html
*.css
*.js
*.js.map
*.cjs
*.mjs
*.json
*.sjson
*.json.bin
*.ts
*.ts.map
*.tsbuildinfo
*.yml
*.tbl
*.ser
*.pl
*.pm
*.t
*.php
*.py
*.lua
*.c
*.cpp
*.h
*.hpp
*.po
*.lng
*.dic
*.lang
*.qm
*.ini
*.cmd
*.bat
*.ps1
*.crt
COPYING
LICENSE
Makefile
.gitignore
.npmignore
.editorconfig
.eslintrc
.DS_Store
*.termcap
*.terminfo
*.res
*.ico
*.bsp
*.nav
*.vtf
*.vdf
*.mdl
*.vvd
*.vtx
*.chroma
*.d3d
*.tga
*.bmp
*.blp
*.pcx
') {
s/^\s+//;
s/\s+$//;
if ($_ eq '') { next }
if ($known{$_}) { next } else { $known{$_}++ }
print "$_\n";
push(@ext, $_);
}
print("\n", join(", ", @ext), "\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment