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
pallymore / yurui_uses.md
Created January 13, 2020 17:53
tools used by Yurui
@pallymore
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
as
$body$
declare
result integer;
query varchar;
begin
query := 'SELECT count(1) FROM ' || schema || '.' || tablename;
execute query into result;
@pallymore
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
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
pallymore / command.sh
Last active August 29, 2015 13:57
local postgres.app 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
pallymore / gist:6868418
Created October 7, 2013 13:55
rails 4 compatible binstubs command.
bundle install --path .bundle --binstubs .bundle/bin
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')