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 ruby | |
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com) | |
# Displays a timeless message in your terminal with cosmic color effects | |
# Usage: add `ruby ~/seeyouspacecowboy.rb; sleep 2` to .bash_logout (or similar) in your home directory | |
# (adjust the sleep variable to display the message for more seconds) | |
class String | |
def colorize(color_code) |
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 OBJECT_SCHEMA_NAME(I.OBJECT_ID) AS SchemaName, | |
OBJECT_NAME(I.OBJECT_ID) AS ObjectName, | |
I.NAME AS IndexName | |
FROM sys.indexes I | |
WHERE -- only get indexes for user created tables | |
OBJECTPROPERTY(I.OBJECT_ID, 'IsUserTable') = 1 | |
-- find all indexes that exists but are NOT used | |
AND NOT EXISTS ( | |
SELECT index_id | |
FROM sys.dm_db_index_usage_stats |