Skip to content

Instantly share code, notes, and snippets.

@vivekragunathan
vivekragunathan / uninstall_node_npm.sh
Last active February 19, 2019 16:38
Script to uninstall node and npm completely from your mac!
dump_dir_name="node_junk_`date +%s%N`"
dump_dir="${HOME}/Temp/${dump_dir_name}/"
echo "NODE/NPM UNINSTALLER v0.0.1
This uninstaller moves all the node/npm files and folders to ${dump_dir}.
Happy cleaning!
"
paths=(
# The main binaries / executables
@jmindek
jmindek / gist:62c50dd766556b7b16d6
Last active January 31, 2024 15:48
DISTINCT ON like functionality for Redshift

distinct column -> For each row returned, return only the unique members of a set. Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.

test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
-----------+------------+-----------------------------
1000040 | 103 | 1000040|2645405726|0001|103