Skip to content

Instantly share code, notes, and snippets.

View msassak's full-sized avatar

Mike Sassak msassak

View GitHub Profile
@msassak
msassak / postgres_queries_and_commands.sql
Created July 13, 2018 20:23 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@msassak
msassak / steps.rb
Created March 2, 2011 20:09 — forked from DCarper/steps.rb
When /^I delete that comment$/ do
Comment.count.should == 1
@comment = Comment.last
debugger
When %Q{I press "X" within "#comments li:first .destroy_comment"}
end
Feature: scenario outline test
Scenario Outline: main table for now
Given an event starts at <TimeA> in <CreateTMZ>
When a user in <ViewTMZ> views the event
Then it will show as starting at <TimeB>
And <Note>
Examples:
| CreateTMZ | TimeA | ViewTMZ | TimeB | Note |
@msassak
msassak / after.rb
Created December 17, 2009 21:47 — forked from jnicklas/after.rb
require 'cucumber/rails/capybara'
@msassak
msassak / java1.rl
Created November 24, 2009 22:08 — forked from aslakhellesoy/java1.rl
/*
* @LANG: java
*/
class java1
{
%%{
machine java1;
alphtype byte;