...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...
...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)
Spreewald's patiently repeats the given block again and again until it either passes or times out.
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...
Inspired by recent "git shortcut" cards I figured it would be nice to have one of these for rebasing a...
...to name any file @imported by SASS with a leading underscore. SASS files not beginning with an underscore will be rendered on their own, which will fail if they are...
If you need to run a program on a remote machine (e.g. to your office PC) with a graphical UI...
When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your...
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
Cookies without an expiration timestamp are called "session cookies". [1] They should only be kept until the end of the...
const wordBreaks = { 'Fahrsicherheitstraining': "Fahr\xADsicherheits\xADtraining", 'Fahrsicherheitszentrum': 'Fahr\xADsicherheits\xADzentrum', 'Kreisverkehrswacht': 'Kreis\xADverkehrswacht', 'Berufsgenossenschaft': 'Berufs\xADgenossenschaft', } const keys = Object.keys(wordBreaks) function textNodes(node){ let textNodes = [] let walk = document.createTreeWalker(node...
...get rather expensive and doing it for every long word does not make it better, but in my case the pages are not very content-heavy and there is no...
When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...
...what "memoize" in earlier rails versions did. There is a gem that reintroduces this behavior, but this is the essential implementation. Remember In the above example, some_expensive_calculation is...
...it will be fixed, I guess it will be for Rails 4 only. The best workaround right now is to lock your version of rack at version...
...remember to nilify it afterwards. Otherwise other examples will see your global changes. A better way is to use the .with_power method to change the current power for the...
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...
ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png
tl;dr Since Rails 7+ you can use ComparisonValidator for validations like greater_than, less_than, etc. on dates, numerics...
Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages...
...On the database level, you will see these queries (simplified; the number at the beginning of each line is the connection ID): 1 Connect 1 BEGIN 1 INSERT INTO foos...
...you might be doing stuff afterwards that could require to abort the transaction). A better approach As a general rule, never use ActiveRecord::Base.establish_connection and also don't use...
You are getting when connecting via SSH or deploying with Capistrano (which uses SSH): Too many authentication failures for username...
Git allows you to set push options when pushing a branch to the remote. You can use this to build...
Usually, Unpoly compiler destructors are returned from the compiler function. However, when using async compiler functions, you can not register...
Terminator has a cool feature that allows you to split your terminal into many panels and type in all of...