How to Remove Box Shadow from Elements

A lot of developers and designers work with bootstrap nowadays and sometimes you need to override rules created by default by the framework. Here’s something I needed to remove a while back.

.progress {
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
}

Progress bars have a default box-shadow. To remove it, simply add a rule to change the value to none

// from bootstrap
.progress {
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
}

//custom
.no-shadow {
    -webkit-box-shadow: none;
    box-shadow:none;
}

Apply this to your own elements

<div class="progress no-shadow">
  <div class="progress-bar no-shadow"></div>
</div>

Done!

.

 Heroku: Cannot run more than 1 Free size dynos

 Cannot run more than 1 Free size dynos.

This is a common error when you forget or cancel a connection to heroku when using commands like:

heroku run rake db:migrate
bc(language-bash). heroku run  rails c --app you_app_name

Check your sessions

You will need to check if you have any sessions running with:

$ heroku ps --app your_app_name
=== web (Free): bundle exec puma -C config/puma.rb (1)
web.1: up 2017/06/13 10:23:38 +0800 (~ 33m ago)

=== worker (Free): bundle exec sidekiq -c 5 -q mailers -q default (1)
worker.1: up 2017/06/13 10:23:19 +0800 (~ 33m ago)

=== run: one-off processes (1)
run.2943 (Free): up 2017/06/13 10:39:57 +0800 (~ 17m ago): rails c

Stop the session

We will need to stop the session so that we can create a new session which we can use.

heroku ps:stop run.2943 --app your_app_name

Try to run your session

$ heroku run rails c --app your_app_name
Running rails c on your_app_name... up, run.9284 (Free)
Loading staging environment (Rails 4.2.8)
[1] pry(main)>

Done!

 How to clear the contents of a file from the command line?

When developing, I usually have a log file for tests and development for me to keep track of what’s happening. The thing is that logs become too large. Some editors or viewers can’t open the file. They are sometimes too large to be usable.

I just delete the contents and fill it up until the next time.

Here are a few ways to delete file contents from the command line.

> filename

> log/development.log

echo

echo "test" > log/test.log

cat

cat /dev/null > log/test.log

There are probably millions of ways to do this but the above are the quickest

cp

cp /dev/null log/development.log 

 PG::DuplicateTable: ERROR: relation "table_name" already exists

StandardError: An error has occurred, this and all later migrations canceled:

PG::DuplicateTable: ERROR:  relation "table_names" already exists
: CREATE TABLE "table_names" ("id" serial primary key, "name" character varying, "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 

This error show when you try to migrate a while the table is already existing.

This error is a result of deleting migration files instead of using the the rails rollback.

Solution

Delete the table using your console

your_app_development=# drop table table_name;
DROP TABLE