Skip to content

Instantly share code, notes, and snippets.

View pallymore's full-sized avatar
Beep. Boop.

Yurui Zhang pallymore

Beep. Boop.
View GitHub Profile
pallymore /
Created January 13, 2020 17:53
tools used by Yurui
pallymore / pg_count_all.sql
Created August 9, 2015 13:20
count rows for all tables in database
create or replace function
count_rows(schema text, tablename text) returns integer
result integer;
query varchar;
query := 'SELECT count(1) FROM ' || schema || '.' || tablename;
execute query into result;
pallymore / split_csv.awk
Created May 20, 2015 17:54
awk command to split csv file by uniq values in the 5th column
awk -F, 'NR==1{hdr=$0;next}!($5 in files){files[$5]=1;print hdr >$5".csv"}{print>$5".csv”}’ input.csv
pallymore / scp_without_dot_files
Created July 3, 2014 14:44
SCP current folder to a remote folder without dotfiles and dotfolders
scp -r [!.]* username@server:/path/to/destination/folder
pallymore /
Last active August 29, 2015 13:57
local logging (logging has to be enabled first) Postgres93 is the name of the postgres app
tail -f ~/Library/Application\ Support/Postgres93/var/pg_log/*
pallymore / gist:6868418
Created October 7, 2013 13:55
rails 4 compatible binstubs command.
bundle install --path .bundle --binstubs .bundle/bin
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')