require 'database_cleaner'
require 'database_cleaner_support'
DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :transaction
FROM ruby:2.5.1 | |
ENV LANG C.UTF-8 | |
RUN apt-get update -qq && \ | |
apt-get install -y --no-install-recommends \ | |
build-essential \ | |
libpq-dev \ | |
libfontconfig1 \ | |
less \ |
Many people who work with React are familiar with the excellent classnames
library. If you aren't familiar, it provides a simple function for gluing classnames together. In web programming in general, there are many times that we need to add or remove multiple classes based on conditional logic. The classnames library makes this easy.
More and more developers are embracing CSS Next and the power of CSS modules. However, when you add CSS modules to your react components, working with classnames gets more difficult. Typically, CSS modules is implemented with class name mangling. Transforming human readable class name strings into unique identifiers helps ensure that every class name in your app is unique.
This means that you can write your component CSS in isolation without worrying about the dreaded class name collisions that have plagued CSS
# /etc/profile.d/best_bash_history.sh | |
# Save 5,000 lines of history in memory | |
HISTSIZE=10000 | |
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing) | |
HISTFILESIZE=2000000 | |
# Append to history instead of overwrite | |
shopt -s histappend | |
# Ignore redundant or space commands | |
HISTCONTROL=ignoreboth | |
# Ignore more |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
It's important to note that running this reset will drop any existing data you have in the application
- Step 1:
heroku restart
- Step 2:
heroku pg:reset DATABASE
(no need to change theDATABASE
) - Step 3:
heroku run rake db:migrate
- Step 4:
heroku run rake db:seed
(if you have seed)
One liner
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2010 Doug Hellmann. All rights reserved. | |
# | |
"""Pretty-print function for ElementTree | |
""" | |
#end_pymotw_header | |
from xml.etree import ElementTree |
=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('Button Value') |