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
if object_id('tempdb..#{{table}}') is not null drop table #{{table}} |
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
select pg_terminate_backend(pid) from pg_stat_activity where datname='$DB_NAME'; | |
DROP DATABASE "$DB_NAME"; |
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
select 'union all select ''' + isc.COLUMN_NAME + ''' as cn, max(len(' + isc.COLUMN_NAME + ')) as length, ' + convert(varchar(5), isc.CHARACTER_MAXIMUM_LENGTH) + ' as maxlen from {{table}} having max(len(' + isc.COLUMN_NAME + ')) > ' + convert(varchar(5), isc.CHARACTER_MAXIMUM_LENGTH) + '' | |
from INFORMATION_SCHEMA.COLUMNS isc | |
where isc.TABLE_NAME = '{{table}}' | |
and isc.CHARACTER_MAXIMUM_LENGTH is not null |
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
tail -n +2 $FILE > $FILE.new |
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
#!/usr/bin/env bash |
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
#!/usr/bin/env python |
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
#!/usr/bin/env awk -f |
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
find . -type d ! -path "*.git*" -empty -exec touch '{}'/.gitkeep \; |
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
# use .DS_Store as notorious example | |
find . -type f -name '.DS_Store' -delete |
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
# use infamous .DS_Store as example. Use `-type d` for dirs | |
find . -type f -name '.DS_Store' -print -exec rm -rf {} \; |