Skip to content

Instantly share code, notes, and snippets.

View mayank-io's full-sized avatar

Mayank Kumar mayank-io

View GitHub Profile
@mayank-io
mayank-io / UpdateEnvironmentPlist.sh
Created February 1, 2017 04:42 — forked from SQiShER/UpdateEnvironmentPlist.sh
Two simple commands to resolve problems with Maven installed via Homebrew
defaults write ~/.MacOSX/environment.plist M2_HOME `brew --prefix maven`/libexec
defaults write ~/.MacOSX/environment.plist M2 `brew --prefix maven`/libexec/bin
@mayank-io
mayank-io / pg_truncate_tables.sql
Created January 9, 2016 07:59
Postgres: Truncate all tables in PUBLIC schema for a given USER
-- Running this snippet creates a function. This function can then be executed
-- in this manner:
-- SELECT truncate_tables('postgres');
CREATE OR REPLACE FUNCTION truncate_tables(_username text)
RETURNS void AS
$func$
BEGIN
RAISE NOTICE '%',
-- EXECUTE -- dangerous, test before you execute!