A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| # Credit Brandon Weiss of http://anti-pattern.com/dirty-associations-with-activerecord | |
| # app/models/dirty_associations.rb | |
| module DirtyAssociations | |
| attr_accessor :dirty | |
| attr_accessor :_record_changes | |
| def make_dirty(record) | |
| self.dirty = true | |
| self._record_changes = record |
| 10 context 'when update products with valid data' do | |
| 9 it do | |
| 8 meta = described_class.enqueue(company.id, bind_data) | |
| 7 binding.pry #NOTE: debugger | |
| 6 | |
| 5 Resque.inline = true | |
| 4 worker = Resque::Worker.new(:company_products) | |
| 3 binding.pry #NOTE: debugger | |
| 2 worker.work(0) | |
| 1 |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
| AllCops: | |
| RunRailsCops: true | |
| # Commonly used screens these days easily fit more than 80 characters. | |
| Metrics/LineLength: | |
| Max: 120 | |
| # Too short methods lead to extraction of single-use methods, which can make | |
| # the code easier to read (by naming things), but can also clutter the class | |
| Metrics/MethodLength: |
| class A | |
| def initialize | |
| p :A | |
| end | |
| end | |
| class B < A | |
| def initialize | |
| p :B | |
| end |
| stage 'Test' | |
| // Split the previously executed tests into 10 jobs | |
| def splits = splitTests parallelism: [$class: 'CountDrivenParallelism', size: 10], generateInclusions: true | |
| def branches = [:] | |
| // Prepare each job | |
| for (int i = 0; i < splits.size(); i++) { | |
| def split = splits[i] | |
| branches["split${i}"] = { | |
| // The job should allocate a new jenkins slave | |
| node('dockerSlave') { |
| FROM tomcat:8.0.38 | |
| # Place the code version inside the webapps directory | |
| ARG PACKAGE_VERSION | |
| RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt | |
| COPY project.war /usr/local/tomcat/webapps/project.war | |
| COPY docker-entrypoint.sh / | |
| RUN chmod +x /docker-entrypoint.sh | |
| ENTRYPOINT ["/docker-entrypoint.sh"] |