Skip to content

Instantly share code, notes, and snippets.

View bellatrix988's full-sized avatar

Marina bellatrix988

View GitHub Profile
@bellatrix988
bellatrix988 / .railsrc
Last active June 11, 2022 14:59
Rails initialisation templates
--database=postgresql
--skip-action-cable
--skip-action-mailer
--skip-bundle
--skip-javascript
--skip-keeps
--skip-test
@secretpray
secretpray / Install Bootstrap 5 without jQuery
Last active February 8, 2024 08:00
Install Bootstrap 5 with tooltip, popover and toasts in Ruby on Rails 6+ (without jQuery)
1) yarn add bootstrap
2) yarn add @popperjs/core
3.1) in folder 'app/javascript/' create new folder 'stylesheets':
mkdir app/javascript/stylesheets/
3.2) in new folder 'stylesheets' create file 'application.scss'
cd app/javascript/stylesheets/
touch application.scss
@bellatrix988
bellatrix988 / .zshrc
Last active July 12, 2022 12:49
Development triks
function rubucop_current_changes() {
current_branch=$(git branch --show-current)
git diff $branch_name develop --name-status | grep '\.rb$' | xargs rubocop
}
alias zshreload="source ~/.zshrc"
@db0sch
db0sch / regenerate_credentials.md
Last active May 11, 2024 10:34
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@ZephiroRB
ZephiroRB / 20160216211105_create_images.rb
Created February 18, 2018 00:20 — forked from dannyvassallo/20160216211105_create_images.rb
Use tinymce-rails & tinymce-rails-imageupload with carrierwave & fog
# db/migrate/filename.rb
# generate with >> rails g model image alt:string hint:string file:string
class CreateImages < ActiveRecord::Migration[5.0]
def change
create_table :images do |t|
t.string :alt
t.string :hint
t.string :file
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@rachelmyers
rachelmyers / Dockerfile
Created September 15, 2016 00:22
A Dockerfile for a Rails app
FROM ruby:2.3
# Set the base directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN mkdir -p /app
WORKDIR /app
# Copy dependencies into the container
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install --jobs 20 --retry 5 --without development test
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@zulhfreelancer
zulhfreelancer / export_import_heroku_database.md
Last active May 6, 2021 14:28
How to export Heroku Postgres Database to Localhost Database (Rails)?

How to export Heroku Postgres Database to Localhost Database (Rails)?

Step 1

$ cd /path/to/your/rails/app
$ heroku pg:backups capture
$ curl -o latest.dump `heroku pg:backups public-url`

OR
@francois-blanchard
francois-blanchard / error_capistrano_deploy_could_not_parse_object.md
Last active January 13, 2021 10:05
Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

  1. Connect you to your server $ ssh user@myserver
  2. Go to your deploy path and select the shared directorycd /your/directory/deploy/shared
  3. Remove the git cache rm -rf cached-copy
  4. Retry to deploy & have fun ;)