pg_search
https://github.com/casecommons/pg_search
Ruby
pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search
BlobHelper#safe_content_type
If we blindly set the 'real' content type when serving a Git blob we are enabling XSS attacks. An attacker could upload e.g. a Javascript file to a Git repository, trick the browser of a victim into downloading the blob, and then the 'application/javascript' content type would tell the browser to execute the attacker's Javascript. By overriding the content type and setting it to 'text/plain' (in the example of Javascript) we tell the browser of the victim not to execute untrusted data.
Edit
git clone [email protected]:casecommons/pg_search.git
cd pg_search
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-BlobHelper-safe_content_type-for-pr
# Commit to gitgit add git commit -m "better docs for BlobHelper#safe_content_type"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-BlobHelper-safe_content_type-for-pr
hub pull-request
# Celebrate!