Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

MICE Portal stereosupersonic

I may be slow to respond.
Block or report user

Report or block stereosupersonic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
View gist:5b3ff53c3784b18796c873d358fb3a44

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by
  • pry -r ./config/environment.rb - load your rails into a pry session


stereosupersonic /
Created Nov 3, 2017 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


View Retry.rb
result = some_method
rescue MyApp::Exception => e
retries ||= 0
retries += 1
raise e if retries > 5
stereosupersonic /
Created Sep 20, 2017
pre-commit prevent master commits
echo -e "[PREVENT] --> init (wait a second)"
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ $BRANCH == master ]; then
echo -e "[PREVENT] --> Non shall commit to master!"
exit 1
echo -e "[PREVENT] --> Prevent commit approved"
stereosupersonic /
Created Sep 20, 2017
rubocop git hook pre-push
echo "pre-push"
echo "Starting rubocop"
bundle exec rubocop
if [ $? -ne 0 ]; then
echo ""
echo ""
echo "Rubocop failed; push aborted!"
View response.json
"user": {
"athlete_profile": {
"gender": "m",
"height": 179,
"weight": 85,
"age": 46,
"goals": ["improve_endurance", "relieve_stress", "burn_fat"],
"skills": ["pullups", "muscleups", "strict_hs_pushups", "toes_to_bar"],
"limitations": [],
AgeGroup performance_class count
Child untrained 44
Child novice 28
Child intermediate 22
Child proficient 10
Child advanced 1
Young subpar 6
Young untrained 373
View test.json
You can’t perform that action at this time.