- Initially install your pry-rails to group development on your apps Gemfile
group :development do
# ..
gem 'pry-rails'
# ..
endgroup :development do
# ..
gem 'pry-rails'
# ..
endPeople
:bowtie: |
๐ :smile: |
๐ :laughing: |
|---|---|---|
๐ :blush: |
๐ :smiley: |
:relaxed: |
๐ :smirk: |
๐ :heart_eyes: |
๐ :kissing_heart: |
๐ :kissing_closed_eyes: |
๐ณ :flushed: |
๐ :relieved: |
๐ :satisfied: |
๐ :grin: |
๐ :wink: |
๐ :stuck_out_tongue_winking_eye: |
๐ :stuck_out_tongue_closed_eyes: |
๐ :grinning: |
๐ :kissing: |
๐ :kissing_smiling_eyes: |
๐ :stuck_out_tongue: |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| // everyone's new favorite closure pattern: | |
| (function(window,document,undefined){ ... })(this,this.document); | |
| // when minified: | |
| (function(w,d,u){ ... })(this,this.document); | |
| // which means all uses of window/document/undefined inside the closure | |
| // will be single-lettered, so big gains in minification. | |
| // it also will speed up scope chain traversal a tiny tiny little bit. |
| # 1. Clear retry set | |
| Sidekiq::RetrySet.new.clear | |
| # 2. Clear scheduled jobs | |
| Sidekiq::ScheduledSet.new.clear | |
| # 3. Clear 'Processed' and 'Failed' jobs |
| Explanation: | |
| ``` | |
| The reason behind this, is that in PostgreSQL (up to 9.3) there is no equality operator defined for json (i.e. val1::json = val2::json will always throw this exception) -- in 9.4 there will be one for the jsonb type. | |
| One workaround is, you can cast your json field to text. But that won't cover all json equalitions. f.ex. {"a":1,"b":2} should be equal to {"b":2,"a":1}, but won't be equal if casted to text. | |
| ``` | |
| Possible ways to fix: | |
| 1) Migrate to Postgresql 9.4 and use .jsonb type |
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |