This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //* | |
| //* See the JS Fiddle: http://jsfiddle.net/sxcjmoj5/3/ | |
| //* | |
| //* | |
| // make sure ngSanitize module is installed: | |
| // https://docs.angularjs.org/api/ngSanitize | |
| // | |
| // To convert links from plaintext, you must use the linky filter which is included with ngSanitize | |
| // https://docs.angularjs.org/api/ngSanitize/filter/linky | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Source: http://goo.gl/qyLFbg | |
| $html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
| preg_match( '@src="([^"]+)"@' , $html, $match ); | |
| $src = array_pop($match); | |
| // will return /images/image.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # support/feature_macros.rb | |
| module FeaturesMacros | |
| def signin_admin | |
| DatabaseCleaner.clean | |
| @user ||= FactoryGirl.create(:user) | |
| visit '/sign_in' | |
| within("#new_user") do | |
| fill_in 'user[email]', :with => user.email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module GeneralInit | |
| def initialize(*h) | |
| puts h == 1 && h.first.kind_of?(Hash) | |
| if h.length == 1 && h.first.kind_of?(Hash) | |
| h.first.each { |k,v| instance_variable_set("@#{k}",v) } | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: UTF-8 | |
| # pt-BR translations for Devise | |
| pt-BR: | |
| devise: | |
| confirmations: | |
| confirmed: "Sua conta foi confirmada com sucesso. Você está logado." | |
| send_instructions: "Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta." | |
| send_paranoid_instructions: "Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta." | |
| failure: | |
| already_authenticated: "Você já está logado." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.configuration.middleware.use Rack::OpenID | |
| Rails.configuration.middleware.use RailsWarden::Manager do |manager| | |
| manager.default_strategies :remember_me_token, :password_form, :api_token, :openid | |
| manager.failure_app = ExceptionsController | |
| end | |
| # Setup Session Serialization | |
| class Warden::SessionSerializer | |
| def serialize(record) |