Skip to content

Instantly share code, notes, and snippets.

View Fivell's full-sized avatar
🏠
Working from home

Igor Fedoronchuk Fivell

🏠
Working from home
View GitHub Profile
@Fivell
Fivell / form.html
Created June 24, 2017 12:34 — forked from runspired/form.html
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">

Issue description

Environment (Sandbox/Production/Both)

Expected behavior

Actual behavior

@Fivell
Fivell / batch_actions.feature
Created March 22, 2017 15:09
batch_actions.feature
BUNDLE_GEMFILE=gemfiles/rails_51.gemfile bundle exec cucumber features/index/batch_actions.feature:4 --backtrace
Using the default profile...
.I, [2017-03-22T17:07:41.657194 #22920] INFO -- : Started GET "/admin/posts" for 127.0.0.1 at 2017-03-22 17:07:41 +0200
I, [2017-03-22T17:07:41.855500 #22920] INFO -- : Started GET "/stylesheets/active_admin.css" for 127.0.0.1 at 2017-03-22 17:07:41 +0200
I, [2017-03-22T17:07:41.857649 #22920] INFO -- : Started GET "/javascripts/active_admin.js" for 127.0.0.1 at 2017-03-22 17:07:41 +0200
I, [2017-03-22T17:07:41.872773 #22920] INFO -- : Started GET "/stylesheets/active_admin/print.css" for 127.0.0.1 at 2017-03-22 17:07:41 +0200
.........F--
(::) failed steps (::)
Scenario: When the belongs to is optional and resources is renamed
Given a configuration of:
"""
ActiveAdmin.register User
ActiveAdmin.register Post, as: "Article" do
belongs_to :user, optional: true
navigation_menu :default
end
"""
@Fivell
Fivell / env.txt
Created January 31, 2017 21:05
env.txt
bundle env
## Environment
```
Bundler 1.14.3
Rubygems 2.6.10
Ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15]
GEM_HOME /Users/igor/.rvm/gems/ruby-2.4.0
GEM_PATH /Users/igor/.rvm/gems/ruby-2.4.0:/Users/igor/.rvm/gems/ruby-2.4.0@global
RVM 1.28.0 (master)
@Fivell
Fivell / console.log
Created January 31, 2017 21:00
console.log
rvm install 2.4.0 --autolibs=homebrew
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.4.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Installing requirements for osx_brew.
Updating system.....
Installing required packages: zlib, zlib.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Coverage report generated for RSpec to /Users/igor/Projects/ruby/gems/activeadmin/coverage. 3614 / 4020 LOC (89.9%) covered.
/Users/igor/.rvm/rubies/ruby-2.2.2/bin/ruby -I/Users/igor/Projects/ruby/gems/activeadmin/gemfiles/vendor/bundle/ruby/2.2.0/gems/rspec-core-3.5.4/lib:/Users/igor/Projects/ruby/gems/activeadmin/gemfiles/vendor/bundle/ruby/2.2.0/gems/rspec-support-3.5.0/lib /Users/igor/Projects/ruby/gems/activeadmin/gemfiles/vendor/bundle/ruby/2.2.0/gems/rspec-core-3.5.4/exe/rspec --pattern spec/requests/\*\*/\*_spec.rb
Run options:
include {:focus=>true}
exclude {:skip=>true}
All examples were filtered out; ignoring {:focus=>true}
......Running JSLint:
@Fivell
Fivell / description.markdown
Created January 24, 2017 22:34 — forked from runemadsen/description.markdown
Reverse polymorphic associations in Rails

Polymorphic Associations reversed

It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media

This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.

@Fivell
Fivell / en-GB.yml
Created January 17, 2017 13:11 — forked from scottlowe/en-GB.yml
en-GB locale for Rails 3
en-GB:
date:
formats:
# Use the strftime parameters for formats.
# When no format has been given, it uses default.
# You can provide other formats here if you like!
default: "%d/%m/%Y"
short: "%d %b"
long: "%d %B, %Y"
@Fivell
Fivell / rocky_raccoon.csv
Created January 14, 2017 22:24 — forked from johana-star/rocky_raccoon.csv
Ruby Riddle: Why doesn't to_proc work on a refined Hash?
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 12 columns, instead of 4. in line 1.
Task ID,Type,Name,Status,Project,Context,Start Date,Due Date,Completion Date,Duration,Flagged,Notes
1,Context,Rocky Raccoon,active
1.1,Action,Now somewhere in the black mountain hills of Dakota,,,Rocky Raccoon,,,,,0,
1.2,Action,There lived a young boy named Rocky Raccoon,,,Rocky Raccoon,,,,,0,
1.3,Action,And one day his woman ran off with another guy,,,Rocky Raccoon,,,,,0,
1.4,Action,He hit young Rocky in the eye,,,Rocky Raccoon,,,,,0,
1.5,Action,Rocky didn't like that he said I'm gonna get that boy,,,Rocky Raccoon,,,,,0,
1.6,Action,So one day he walked into town,,,Rocky Raccoon,,,,,0,
1.7,Action,Booked himself a room in the local saloon,,,Rocky Raccoon,,,,,0,
1.8,Action,Rocky Raccoon checked into his room,,,Rocky Raccoon,,,,,0,