Skip to content

Instantly share code, notes, and snippets.

View dcangulo's full-sized avatar
💻

David Angulo dcangulo

💻
View GitHub Profile
@yalab
yalab / bootstrap-memo.md
Last active July 20, 2022 20:29
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@slothelle
slothelle / Gemfile
Last active December 18, 2018 02:43
Deploying Rails 4 apps with Resque and Redis to Heroku using Unicorn with a Procfile.
# and whatever other gems you need
gem 'resque', '~> 1.24.1'
gem 'unicorn', '~> 4.6.2'
@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active May 24, 2023 22:08
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@luisalima
luisalima / shoulda_cheat_model.rb
Created December 19, 2012 19:02
Shoulda model testing cheat sheet
# updated from the original @ http://cheat.errtheblog.com/s/rspec_shoulda
# just a subset -- models -- is included here. I'll update this, and create cheat sheets for others, as I go along.
# I marked the ones I added with NEW and also added the links to the corresponding code, as I think it's useful.
# Any comments/corrections are welcome!
# ================= Data and Associations =======================
# https://github.com/thoughtbot/shoulda-matchers/tree/master/lib/shoulda/matchers/active_record
it { should_not have_db_column(:admin).of_type(:boolean) }