This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| To convert a multipage PDF document to a single image using ImageMagick, do the following: | |
| # Replace <document> with name of actual document. | |
| # The '%04d' will add four digits that will increment and have leading 0's (e.g. document_0000.png, document_0001.png, document_0002.png, etc) | |
| -> convert <document>.pdf <document>_%04d.png | |
| -> convert <document>_0*.png -append -flatten final.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Project < ActiveRecord::Base | |
| has_many :favorites, as: :favorited | |
| has_many :fans, through: :favorites, source: :user | |
| end | |
| # note: the key you use for the user has_many can really be anything you want. Try and use something that describes what the | |
| # assocation is, though. | |
| # | |
| # You can now do the following in order to retrieve the users who have favorited a particular project. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # I didn't write those, ;) all props go to http://stackoverflow.com/users/110735/clint-modien | |
| # | |
| # The following bash functions show you the difference in commits between the branch you are on | |
| # and another branch that you either want to commit too or merge from. | |
| # | |
| # USAGE: | |
| # gbout branch_i_want_to_push_too [-p, --raw] | |
| # gbin branch_i_want_to_pull_from [-p, --raw] | |
| # |
OlderNewer