This file contains 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
# fastlane automated | |
# https://fastlane.tools/ | |
# | |
function fasterlane { | |
# no arguments received? tell usage | |
if [ -z "$1" ]; then | |
echo "Usage: fasterlane <lane>" | |
echo " (dotenv, bundler, fastlane setup required)" | |
else | |
# look for ./android directory |
This file contains 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 | |
# queries in the environment must show SQL | |
# | |
# ActiveRecord::Base.verbose_query_logs = true | |
ActiveRecord::Base.logger = Logger.new($stdout) if defined?(ActiveRecord) | |
# | |
# Attempts to load the given gem | |
# |
This file contains 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 | |
# What? A quick script written to ensure (add, unless exists) Mailgun routes for proxy SMTP of users | |
# Why? because the client was doing it manually for thousands of users | |
# When? I saw a team member working late night punching all that routes, so decided to automate for him | |
# Where? based on a need in a comercial product | |
# How? just searched for an API, found one. automated. | |
# | |
require 'rest-client' | |
require 'json' |
This file contains 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
# Example: optimizing the code for performance (subject to the business logic) | |
# Purpose: Fetch all comments where author name matches given `username` | |
# WARN: this is a pseudo code for demonstration purpose only | |
# | |
# assuming this is a rails controller | |
# bad code | |
class CommentsController < ApplicationController | |
# action | |
def users_comments | |
# FIXME: very costly on resources and performance |
This file contains 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
Feature: User receives email copies | |
With proxy or non-proxy setup, a user will always receive copies of emails | |
Background: Client, User, Alias and incdent | |
Given a <client> | |
And an <smtp> setup with a sender email address | |
And a user with <email> and <alias> | |
And an incident reported |
This file contains 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
Scenario Outline: Shipping options | |
Given the following shipping_options: | |
| description | price | | |
| UPS Overnight shipping | 60 | | |
| UPS 2 day shipping | 28 | | |
| UPS Ground Shipping | 16 | | |
And "default" coupon_code for "direct_to_consumer" group has "<_ship>" shipping | |
When I go to the online store | |
And I choose "product_complete" | |
And I choose "S2228" |
This file contains 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
// developer: RamOnRails.in | |
// purpose: fetch form data as JSON | |
// parameters: | |
// form: the form object | |
// arg: [optional] query selector to pick elements | |
// defaults: arg: "input, select, textarea" | |
function toJSON(form, arg = null) { | |
// we will capture the elements and their values in this object | |
let hash = {}; | |
// arg converted to string |
This file contains 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
# What is it? | |
# => Helper methods for Apartment::Tenant gem | |
# How does it work? | |
# * bin/rails console => auto-loads and asks to switch tenant | |
# * T.ask => anytime in console, to switch tenant from a list | |
# * T.me => same as Apartment::Tenant.current | |
# * T.hash => hash of tenants. Example: { 0 => "public", 1 => "tenant-a" } | |
# * T.names => array with all existing tenant names from DB | |
# * T.exists?(arg) => returns true/false if `arg` exists as tenant in DB | |
require "rubygems" |
This file contains 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 | |
# author: ramonrails.in | |
# version: 1.0 | |
# release date: 7-Aug-2017 | |
# license: MIT | |
# style for output | |
bold=$(tput bold) | |
cyan=$(tput setaf 6) |
This file contains 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
# config/initializers/assets.rb | |
javascripts = [...] | |
stylesheets = [...] | |
images = [...] | |
fonts = [...] | |
# NOTE: dynamically include for precompile: controller specific .coffee, .js and .scss, .css | |
# | |
# step 1: collect controller basenames | |
controllers = Dir.glob(File.join(Rails.root, 'app', 'controllers', '*.rb')) |