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
| =begin | |
| - caso não tenha produto, renderizamos um skeleton | |
| - caso tenha produto, renderizamos os produtos buscados | |
| - seria interessante que um componente tenha a responsabilidade de renderizar um skeleton ou os produtos buscados | |
| <% if products.present? %> | |
| <% products.each do |product| %> | |
| <div class="grid-col-xs-12 grid-col-sm-6"> | |
| <%= render ProductComponent.new(product:) %> | |
| </div> |
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
| # frozen_string_literal: true | |
| module Books | |
| class GenerateArticlesJob | |
| include Sidekiq::Worker | |
| sidekiq_options retry: 1 | |
| sidekiq_retries_exhausted do |message, exception| | |
| Rollbar.error(exception, message) |
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
| # Watermarking image with another image using Imagemagick 'composite', 'watermark' and 'dissolve'. | |
| require "rmagick" | |
| Dir.entries("./target").each_slice(7) do |group| | |
| group.each do |target_photo| | |
| next if target_photo == "." || target_photo == ".." | |
| # This is necessary to don't explode your memory | |
| GC.start | |
| GC.disable |
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
| # Dependencies | |
| # Usage: | |
| # make | |
| default: install | |
| install: dependencies mysql memcached elasticsearch redis | |
| dependencies: qt5 | |
| brew tap homebrew/services |
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
| #!/bin/bash | |
| vcr='(VCR)' | |
| all_bettewen_quotes='(\".+\")' | |
| declare -a files | |
| count=0 | |
| # Read file and get all cassettes from VCR | |
| while read line; do | |
| if [[ $line =~ $vcr ]]; then | |
| [[ $line =~ $all_bettewen_quotes ]] |
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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
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 CreateComments < ActiveRecord::Migration | |
| def change | |
| create_table :comments do |t| | |
| t.references :post, null: false | |
| t.references :user, null: false | |
| t.text :description | |
| t.timestamps | |
| end |
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
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: nginx | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the nginx web server | |
| # Description: starts nginx using start-stop-daemon |
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 DocumentUploader < CarrierWave::Uploader::Base | |
| storage :file | |
| def store_dir | |
| "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" | |
| end | |
| def extension_white_list | |
| %w(pdf) | |
| end |
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
| #For remove containers | |
| sudo docker ps -a | grep Exit | awk '{print $1}' | sudo xargs docker rm | |
| #For remove images | |
| sudo docker rmi imageid |
NewerOlder