Skip to content

Instantly share code, notes, and snippets.

View amerryma's full-sized avatar

Aaron Merryman amerryma

View GitHub Profile
@amerryma
amerryma / counting-lines-of-code-with-github-linguist.md
Last active September 27, 2024 23:03
Counting Lines of Code with GitHub Linguist and Bash

Counting Lines of Code with GitHub Linguist and Bash

If you’re using GitHub Linguist to analyze your project’s code, you may want to take a closer look and see how many lines each individual file contains. GitHub Linguist provides a useful breakdown of the languages and files, but not an easy way to get line counts for each file. Let’s dive into how you can achieve this using a combination of GitHub Linguist, jq, and some classic Bash commands.

Why Count Lines of Code Per File?

Analyzing lines of code (LOC) per file is a useful metric to:

  • Assess Complexity: Identifying files with excessive lines of code might highlight areas that could benefit from refactoring.
  • Identify Hotspots: Knowing where most of the code resides helps focus efforts for documentation or optimization.
  • Track Growth: Monitoring LOC helps gauge how your project is evolving over time.
@amerryma
amerryma / gap-vs-spacing.md
Last active October 16, 2024 17:11
Gap Vs Spacing

There are various ways to deal with spacing within a Mui Grid. spacing has always been the "go-to" method, but there are always a few different options when it comes to making your grid less compact. All of these can work but have a few weird caveats that a developer should understand.

Spacing using a Stack

<Stack padding={1} spacing={3} direction="row" flexWrap="wrap">
    <Typography>Hello</Typography>
    <Typography>World</Typography>
@amerryma
amerryma / core-keeper-world-upload.md
Created August 16, 2024 14:49
Core Keeper World Upload
  1. Create your Core Keeper world

  2. Start it one time

  3. Shut it down after it is in the Running state (this will ensure the base files are created)

  4. Go back to world settings

    chrome_SDbjkVdn05

  5. Go to Files

    chrome_R1BuFECb0x

@amerryma
amerryma / TestComponent-nock.test.tsx
Created May 19, 2022 15:55
Supabase Mocking (Regular Mocking vs API Nock)
import '@testing-library/jest-dom'
import { render } from '@testing-library/react'
import { renderHook } from '@testing-library/react-hooks'
import nock from 'nock'
import TestComponent from './TestComponent'
const mockResultData = [
{
@amerryma
amerryma / environments.md
Created October 13, 2017 21:56
All Environments

Environment Variables

Common .env.example

# common
MASTER_KEY=masterKey #optional
JWT_SECRET=jwtSecret #required
DEBUG=false #required
PROGRAM_NAME=fathom-common #required
@amerryma
amerryma / farm-run.md
Last active March 12, 2017 23:12
Farm Run

Herbs

  • Drink Perfect Plus
  • Teleport to Wilderness Patch with Wildy Sword 4 (operate, 1, 1, space, 1)
  • Activate Aura + Juju, pick, run to corp and
  • Teleport to cabbage patch, equip shield
  • Teleport using Ectophial or farmer hat or
  • Teleport to Ardy with Ardy Cape 4 (teleports, 2)
  • Teleport to