The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
def embedded_svg(filename, options = {}) | |
assets = Rails.application.assets | |
file = assets.find_asset(filename).body.force_encoding("UTF-8") | |
doc = Nokogiri::HTML::DocumentFragment.parse file | |
svg = doc.at_css "svg" | |
if options[:class].present? | |
svg["class"] = options[:class] | |
end | |
raw doc | |
end |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control
and E-Tag
headers, etc.), minification, etc.
# update & install | |
brew update | |
brew install postgres | |
# create postgres db | |
postgres -D /usr/local/var/postgres | |
create your username db | |
createdb `whoami` |
# editorconfig.org | |
root = true | |
[*] | |
charset = utf-8 | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
1. Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader) | |
`npm install --save-dev [email protected] node-sass sass-loader` | |
2. Install nuxt plugin of bootstrap vue (includes bootstrap-vue as a dependency) | |
`npm install @nuxtjs/bootstrap-vue` | |
3. Register plugin as module in nuxt.config.js (see below) | |
4. Create app.scss entry point (see below) |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}'
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
class [Your Class Here] < ActiveRecord::Base | |
################################################################################################## | |
### Attributes ################################################################################### | |
################################################################################################## | |
### Constants #################################################################################### | |
root = true | |
[*] | |
charset = utf-8 | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
[*.md] |
# Compiled files | |
*.tfstate | |
*.tfstate.backup | |
*.tfstate.lock.info | |
# logs | |
*.log | |
# Directories | |
.terraform/ |