A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| class PaymentsController < ApplicationController | |
| before_filter :authenticate_member! | |
| autocomplete :company, :name, :full => true, :extra_data => [:address1, :address2, :city, :state, :zip, :business_category_id, :revenue_id], :scopes => [:inactive] | |
| respond_to :json, :only => [:dues] | |
| def index | |
| end | |
| def new | |
| @payment = Payments.new(:member_id => current_member) |
| # username = "my_username" | |
| # pwd = "my_password" | |
| # target_path = "my_target_path" | |
| # saving auth cookie | |
| system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \ | |
| https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027} | |
| (25..600).each do |i| |
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| de: | |
| devise: | |
| confirmations: | |
| confirmed: "Vielen Dank für Deine Registrierung. Bitte melde dich jetzt an." | |
| confirmed_and_signed_in: "Vielen Dank für Deine Registrierung. Du bist jetzt angemeldet." | |
| send_instructions: "Du erhältst in wenigen Minuten eine E-Mail, mit der Du Deine Registrierung bestätigen kannst." | |
| send_paranoid_instructions: "Falls Deine E-Mail-Adresse in unserer Datenbank existiert erhältst Du in wenigen Minuten eine E-Mail mit der Du Deine Registrierung bestätigen kannst." | |
| failure: |
| # Italian translation for Devise 3.2 | |
| # Date: 2013-20-12 | |
| # Author: xpepper | |
| # Note: Thanks to fuzziness (https://gist.github.com/fuzziness/5262777) | |
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| it: | |
| devise: | |
| confirmations: | |
| confirmed: "Il tuo account è stato correttamente confermato. Ora sei collegato." |
| class Email < ActiveRecord::Base | |
| # Nope, it's not RFC compliant. F*** that regex. | |
| # http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html | |
| EmailRegex = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.freeze | |
| before_validation :strip_spaces | |
| # Public: The email address. | |
| # column :address |
A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576
| #=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_on('Button Value') |
This is a collection of links, examples and rants about Presenters/Decorators in Rails.
The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.
Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html
| page.execute_script("$('.selectize-input input').val('ber')") | |
| sleep 0.5 | |
| page.execute_script("$('.selectize-input input').keyup()") | |
| sleep 0.5 | |
| page.execute_script("$('.full-name').mousedown()") | |
| # https://github.com/brianreavis/selectize.js/blob/master/src/selectize.js |