Skip to content

Instantly share code, notes, and snippets.

View ziaulrehman40's full-sized avatar
🎯
Focusing

Zia Ul Rehman ziaulrehman40

🎯
Focusing
  • Devsinc
  • Lahore
View GitHub Profile
@ziaulrehman40
ziaulrehman40 / CircleCI 2.0 Parallel builds coverage report to codeclimate.md
Created December 21, 2018 08:58
CircleCI 2.0 Parallel builds SimpleCov coverage report for CodeClimate reporting

First of all you have to follow my other gist here: https://gist.github.com/ziaulrehman40/1516c0bb940b6ee653b57387cee4e62d In that gist, follow the second solution which is: Use deploy step in simple CircleCI 2.0 build

After that is done and everything seems working. Than there is very little needing to be done.

We will use CodeClimate's new way of reporting, which is cc-test-reporter, this is a binary to work with any kind of projects. Before this we had specific gem and other language specific solutions. Those are deprecated. And gem doesn't work with simplecov > 0.13

Ok, enough talk, now straight to action, following is the circleci config i used:

@ziaulrehman40
ziaulrehman40 / PDF.js rails integration notes for S3 hosted files.md
Last active September 4, 2018 06:44
Integrate PDF.js plugin in rails apps to properly display PDFs hosted on S3 in iframe on ipads/iphones, solving problem that ipads only display frist page of pdf

Integrate PDF.js plugin in rails apps

PDF.js is a plugin for displaying pdfs in webpages, it solves a problem on ipads too(indirectly) where ipads and iphones only render first page of the pdf and users can't scroll pdfs rendered in iframes.

pdfjs_rails is the gem which we are going to use for integrating PDF.js in rails.

This gem is pretty old and not maintained, its last commit in master was 5 years ago(at the time of writing). But nevertheless it works and you can easily get you pdfs working in iPads and iPhone. tada!

There are only a few steps which i had to perform to get it working for S3 hosted files on non-public buckets.

@ziaulrehman40
ziaulrehman40 / jquery file upload rails installation.md
Last active May 26, 2017 08:15
blueimp/jQuery-File-Upload rails gem through rails-assets

blueimp/jQuery-File-Upload is a very helpful plugin, but using it in rails(<5.1, in rails 5.1 and above, we have webpack and yarn support, i would love to see how these work and if anyone can add how to add this library using that that would be great) is a pain like every other js library.
This is to have record of how i managed to get it working on rails, without manually adding all js files.

Using rails-assets to add gemfile https://rails-assets.org/#/components/jquery-file-upload
Pre-req: Jquery-ui configured.

Gemfile:
gem 'rails-assets-', source: 'https://rails-assets.org'