Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Beep. Boop.

Yurui Zhang pallymore

🤖
Beep. Boop.
View GitHub Profile
@pallymore
pallymore / yurui_uses.md
Created Jan 13, 2020
tools used by Yurui
View yurui_uses.md
@pallymore
pallymore / pg_count_all.sql
Created Aug 9, 2015
count rows for all tables in database
View pg_count_all.sql
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
awk command to split csv file by uniq values in the 5th column
View split_csv.awk
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 Jul 3, 2014
SCP current folder to a remote folder without dotfiles and dotfolders
View scp_without_dot_files
scp -r [!.]* username@server:/path/to/destination/folder
@pallymore
pallymore / command.sh
Last active Aug 29, 2015
local postgres.app logging (logging has to be enabled first) Postgres93 is the name of the postgres app
View command.sh
tail -f ~/Library/Application\ Support/Postgres93/var/pg_log/*
@pallymore
pallymore / gist:6868418
Created Oct 7, 2013
rails 4 compatible binstubs command.
View gist:6868418
bundle install --path .bundle --binstubs .bundle/bin
View capybara cheat sheet
=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')