In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| // this script reads through app/locales/*/*.json, copies them to public/locales, | |
| // and generates a typescript file that can be used for making nice typings. | |
| // it can be extended in the future to actually read the contents to allow for | |
| // typesafe interpolation of variables. | |
| import { join, relative } from "node:path"; | |
| import { cp, rm, writeFile } from "node:fs/promises"; | |
| import { promisify } from "node:util"; | |
| import { glob } from "glob"; | |
| import camelCase from "camelcase"; |
| import Stripe from 'stripe' | |
| const stripe = new Stripe(process.env.STRIPE_SECRET_KEY) | |
| export const action = async ({request}) => { | |
| const secret = 'whsec_...' // process.env.WEBHOOK_SIGNING_SECRET | |
| const sig = request.headers.get('stripe-signature') | |
| let event; | |
| const payload = await request.text() |
| angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
| .run(function(DB) { | |
| DB.init(); | |
| }); |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |