Skip to content

Instantly share code, notes, and snippets.

def create
@user = ::User.authenticate(params[:session][:email],
params[:session][:password])
if @user.nil?
flash.now[:notice] = "Bad email or password."
render :template => 'sessions/new', :status => :unauthorized
else
if @user.email_confirmed?
remember(@user) if remember?
sign_user_in(@user)
def deny_access(flash_message = nil, opts = {})
store_location
flash[:failure] = flash_message if flash_message
redirect_to new_session_url
end
def create
@user = ::User.authenticate(params[:session][:email],
params[:session][:password])
if @user.nil?
flash.now[:notice] = "Bad email or password."
render :template => 'sessions/new', :status => :unauthorized
else
if @user.email_confirmed?
remember(@user) if remember?
sign_user_in(@user)
Feature: Catalog Version
In order to better support our customers
In order to ease migration difficulties
As a support administrator for PingFederate
I want to catalog the configuration archives of different versions
Scenario: Import version
Given I am on the version management page
        And I follow New Version
And I have a valid data archive featuring <Path> and <Contents>
<td class="price-column numeric">
<span class="in_place_editor_field" id="tickets__tickets-update_column-345-price-cell" tag="span">25.0</span><script type="text/javascript">
//<![CDATA[
new Ajax.InPlaceEditor('tickets__tickets-update_column-345-price-cell', '/tickets/tickets/update_column/345?column=price', {ajaxOptions:{method: 'post'}, cancelText:'Cancel', clickToEditText:'Click to edit', evalScripts:true, htmlResponse:false, loadingText:'Loading&hellip;', okText:'Update', savingText:'Saving&hellip;'})
//]]>
</script>
</td><td class="price-column numeric">
<span class="in_place_editor_field" id="tickets__tickets-update_column-346-price-cell" tag="span">35.0</span><script type="text/javascript">
//<![CDATA[
new Ajax.InPlaceEditor('tickets__tickets-update_column-346-price-cell', '/tickets/tickets/update_column/346?column=price', {ajaxOptions:{method: 'post'}, cancelText:'Cancel', clickToEditText:'Click to edit', evalScripts:true, htmlResponse:false, loadingText:'Loading&hellip;', okText:'Update
@endymion
endymion / gist:1072322
Created July 8, 2011 17:26
Kung Fu Staff Movie Recommendations from Chad
  • The Forbidden Kingdom
  • Hero
  • Brotherhood of the Wolf
  • Kung Fu Hustle
  • Matrix 2
@endymion
endymion / wait_until.rb
Created March 9, 2012 17:59 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
@endymion
endymion / gist:2286043
Created April 2, 2012 18:23
Media queries for tablet/phone landscape/portrait
HTML:
<meta name='viewport' content='width=device-width'>
CSS:
/* iPhone portrait */
@media only screen and (max-width: 320px) and (orientation: portrait) {
}
@endymion
endymion / gist:2286052
Created April 2, 2012 18:24
Media queries for tablet/phone landscape/portrait
HTML:
<meta name='viewport' content='width=device-width'>
CSS:
/* phone portrait */
@media only screen and (max-width: 320px) and (orientation: portrait) {
}
<?php
$structure = sys_get_temp_dir().'/bla';
if (is_dir($structure)) {
echo ('Directory exists: ' . $structure);
}
else {
if (!mkdir($structure, 0, true)) {
die('Failed');