Skip to content

Instantly share code, notes, and snippets.

@ronzalo
ronzalo / safe_merge.sh
Last active May 16, 2018 21:28 — forked from gonzalo-bulnes/safe_merge.sh
Some merging rules to make collaboration easier through repository order. Think of rebasing as updating the context in which you write your feature, see also: https://gonzalo-bulnes.github.io/blog/gardening_with_git/context-from-scratch.html
# safe merge
#
# merge the branch XXXXXXXX-add-example-feature into master
# make sure the feature is properly tested and
# doesn't break anything in its original context
git checkout XXXXXXXX-add-example-feature
rake # the test suite MUST NOT raise any error
# make sure your local copy of master is up-to-date
@Lumbe
Lumbe / rails-yarn.md
Last active October 16, 2023 02:05
add js libraries to rails project with yarn

How to add js library to Ruby on Rails project with yarn

1. Install yarn on your system. For Debian/Ubuntu Linux:

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
$ sudo apt-get update && sudo apt-get install yarn

2. To add any library, for example jquery, to Ruby on Rails 5.1 application with yarn(from npm) type in terminal:

$ yarn add jquery
@skyriverbend
skyriverbend / rails_switch_branch.py
Created November 15, 2012 05:54
Rails: Switch branches and run migrations
#!/usr/local/bin/python
"""
To use this script, you must be in the root directory of a Rails project that
is using git. You should also make sure that your directory does not contain any
uncommitted changes. Then run:
$ python rails_switch_branch.py name_of_another_branch
Running the above will do the following: