Skip to content

Instantly share code, notes, and snippets.

## Plan + Subscription Relationship
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
class Plan < ApplicationRecord
has_many :subscriptions
end
## Plan + Subscription Relationship
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
class Plan < ApplicationRecord
has_many :subscriptions
end

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@DanielAmah
DanielAmah / index.js
Last active September 9, 2020 22:43
Code review for Konga expo react native app
// Move axios calls to a single file. Say in the utils folder. You can name it api-client.js and add the following line
import axios from "axios";
import { BASE_URL } from "react-native-dotenv";
import AsyncStorage from "@react-native-community/async-storage";
const axiosInstance = axios.create({ baseURL: BASE_URL });
export const storeData = async (key, value) => {
import { StyleSheet, Platform } from "react-native";
import { Colors, Typography, Mixins } from "../../styles";
const SIZE_10 = 10;
const SIZE_20 = 20;
const SIZE_30 = 30;
const SIZE_40 = 40;
const PERCENT_100 = "100%";
const BORDER_RADIUS = Typography["BORDER_RADIUS"];
const PRIMARY_COLOR = Colors["PRIMARY"];
@DanielAmah
DanielAmah / configure-ec2-instance.md
Created April 1, 2024 17:46 — forked from linuxdevops-34/configure-ec2-instance.md
Complete guide for deploying rails application to aws ec2 instance, using capistrano as deploying tool with nginx & puma server

Deploy Rails Application to AWS EC2

Creating AWS EC2 Instance

- login to 'AWS Management Console' (https://aws.amazon.com/console/)
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
  change 'Configure Instance Details' or used as default settings