Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| /** | |
| * This plugin hook for React table provides the ability for percentage | |
| * widths to be provided in the column definitions, whilst maintaining the | |
| * ability to resize those columns. | |
| */ | |
| export const usePercentageColumns = hooks => { | |
| hooks.useInstance.push(useInstance) | |
| hooks.getRowProps.push(getRowStyles) | |
| hooks.getHeaderProps.push(getHeaderProps) | |
| hooks.getCellProps.push(getCellProps) |
| # This works even with really weird filenames like $'--$`\! *@ \a\b\e\E\f\n\r\t\v\\\"\' ' | |
| file_count() | |
| { | |
| if [ ! -e "$1" ] | |
| then | |
| exit 1 | |
| fi | |
| local -i files=$(find "$(readlink -f -- "$1")" -type f -print0 | grep -cz -- -) | |
| echo $files |