Convert Figma logo to code with AI

MikeMcQuaid logostrap

👢 Bootstrap your macOS development system.

2,282
232
2,282
0

Top Related Projects

44,422

🍺 The missing package manager for macOS (or Linux)

💀 Homebrew/bundle (merged into Homebrew/brew)

8,550

A shell script to set up a macOS laptop for web and mobile development.

@holman does dotfiles

🍻 A CLI workflow for the administration of macOS applications distributed as binaries

Quick Overview

Strap is a script designed to bootstrap a minimal macOS development system. It automates the process of setting up a new Mac for development, including installing essential tools, configuring system preferences, and setting up common development environments.

Pros

  • Saves time and effort in setting up a new Mac for development
  • Ensures consistency across different machines and team members
  • Customizable to fit specific development needs
  • Includes security best practices out of the box

Cons

  • Limited to macOS systems only
  • May require some customization for specific use cases
  • Could potentially overwrite existing configurations if not used carefully
  • Requires some familiarity with command-line tools and macOS

Getting Started

To get started with Strap, follow these steps:

  1. Open Terminal on your Mac.
  2. Run the following command to download and execute the Strap script:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/MikeMcQuaid/strap/master/bin/strap.sh)"
  1. Follow the on-screen prompts to complete the setup process.
  2. Optionally, create a .Brewfile in your home directory to customize the packages and applications installed by Homebrew.

Note: It's recommended to review the script and understand what it does before running it on your system. You can also fork the repository and customize it to fit your specific needs before running it.

Competitor Comparisons

44,422

🍺 The missing package manager for macOS (or Linux)

Pros of brew

  • Comprehensive package management system for macOS
  • Large community and extensive package repository
  • Supports multiple programming languages and tools

Cons of brew

  • More complex setup process
  • Requires more system resources
  • Can potentially conflict with system-installed packages

Code Comparison

strap:

#!/bin/bash
set -e

# Check for Xcode Command Line Tools
xcode-select --install 2>/dev/null || true

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew:

class Formula
  def install
    system "./configure", "--prefix=#{prefix}"
    system "make", "install"
  end
end

strap is a lightweight script focused on bootstrapping a macOS system with essential tools, including Homebrew. It provides a quick and straightforward setup process.

brew, on the other hand, is a full-featured package manager with a more complex codebase. It offers a wide range of functionalities for installing, updating, and managing packages on macOS.

While strap is designed for initial system setup, brew is intended for ongoing package management and maintenance. strap can be seen as a precursor to using brew, as it includes the installation of Homebrew itself.

💀 Homebrew/bundle (merged into Homebrew/brew)

Pros of homebrew-bundle

  • Focused specifically on managing Homebrew packages and dependencies
  • Integrates seamlessly with existing Homebrew workflows
  • Allows for easy sharing and versioning of Brewfile configurations

Cons of homebrew-bundle

  • Limited to Homebrew-related tasks and package management
  • Requires manual setup and configuration of other system settings
  • Less comprehensive for full system bootstrapping

Code Comparison

homebrew-bundle:

brew "git"
cask "visual-studio-code"
mas "Xcode", id: 497799835

strap:

#!/bin/bash
set -e

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Summary

homebrew-bundle is a specialized tool for managing Homebrew packages and dependencies, offering seamless integration with existing Homebrew workflows. It excels in package management but is limited in scope compared to strap. strap, on the other hand, provides a more comprehensive system bootstrapping solution, automating various setup tasks beyond just package management. While homebrew-bundle offers easier sharing of package configurations, strap offers a broader range of system setup capabilities.

8,550

A shell script to set up a macOS laptop for web and mobile development.

Pros of laptop

  • More comprehensive setup, including additional development tools and languages
  • Customizable through a ~/.laptop.local file for personal preferences
  • Supports both macOS and Linux operating systems

Cons of laptop

  • Less focused on security and automation compared to strap
  • May install more software than necessary for some users
  • Requires manual execution and interaction during setup

Code comparison

laptop:

fancy_echo "Installing Homebrew ..."
  if ! command -v brew >/dev/null; then
    curl -fsS \
      'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
  fi

strap:

if [[ ! -f "$STRAP_BREWFILE" ]]
then
  STRAP_ISSUES="$STRAP_ISSUES
You have no Brewfile at $STRAP_BREWFILE!"
  return 1
fi

Summary

laptop is a more comprehensive setup tool that supports both macOS and Linux, offering a wider range of development tools and languages. It allows for customization through a local configuration file. However, it may install more software than needed and requires manual interaction during setup.

strap, on the other hand, focuses more on security and automation, particularly for macOS. It emphasizes using a Brewfile for package management and provides a more streamlined, hands-off setup process. However, it may not offer as extensive a range of development tools out of the box compared to laptop.

@holman does dotfiles

Pros of dotfiles

  • More comprehensive configuration management, covering a wide range of tools and applications
  • Modular structure allows for easy customization and selective use of configurations
  • Includes scripts for automating various tasks and improving workflow

Cons of dotfiles

  • Requires more manual setup and configuration compared to Strap's automated approach
  • May include unnecessary configurations for some users, potentially leading to bloat
  • Less focus on system-level setup and bootstrapping

Code Comparison

dotfiles:

# Load all files in ~/.dotfiles/source/
for file in ~/.dotfiles/source/*; do
  [ -r "$file" ] && [ -f "$file" ] && source "$file"
done

Strap:

def install_homebrew
  return if system("brew --version >/dev/null 2>&1")
  system 'bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
end

The dotfiles example shows how it sources multiple configuration files, while the Strap example demonstrates its focus on system-level setup by installing Homebrew.

🍻 A CLI workflow for the administration of macOS applications distributed as binaries

Pros of homebrew-cask

  • Larger community and more extensive collection of casks
  • Integrated with Homebrew, providing a unified package management experience
  • Regular updates and maintenance from a dedicated team

Cons of homebrew-cask

  • Focuses solely on application installation, not overall system setup
  • May require more manual intervention for custom configurations
  • Larger codebase, potentially more complex for contributors

Code Comparison

strap:

#!/bin/bash
set -e

# Check if Xcode Command Line Tools are installed
if ! [ -f "/Library/Developer/CommandLineTools/usr/bin/git" ]; then
  xcode-select --install
fi

homebrew-cask:

cask "example-app" do
  version "1.2.3"
  sha256 "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z"

  url "https://example.com/app-#{version}.dmg"
  name "Example App"
  desc "Description of the example app"
  homepage "https://example.com/"

The strap code focuses on system setup, while homebrew-cask defines application installation parameters. Strap uses bash scripting for system-level operations, whereas homebrew-cask employs Ruby DSL for defining casks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Strap

A script to bootstrap a minimal macOS development system. This does not assume you're doing Ruby/Rails/web development but installs the minimal set of software every macOS developer will want.

Motivation

Replacing Boxen in GitHub with a better tool. This post outlines the problems with Boxen and requirements for Strap and other tools used by GitHub: https://mikemcquaid.com/2016/06/15/replacing-boxen/

Features

  • Enables sudo using TouchID
  • Enables the macOS screensaver password immediately (for better security)
  • Enables the macOS application firewall (for better security)
  • Adds a Found this computer? message to the login screen (for machine recovery)
  • Enables full-disk encryption and saves the FileVault Recovery Key to the Desktop (for better security)
  • Installs the Xcode Command Line Tools (for compilers and Unix tools)
  • Agree to the Xcode license (for using compilers without prompts)
  • Installs Homebrew (for installing command-line software)
  • Installs the latest macOS software updates (for better security)
  • Installs dotfiles from a user's https://github.com/username/dotfiles repository. If they exist and are executable: runs script/setup to configure the dotfiles and script/strap-after-setup after setting up everything else.
  • Installs software from a user's Brewfile in their https://github.com/username/homebrew-brewfile repository or .Brewfile in their home directory.
  • A simple web application to set Git's name, email and GitHub token (needs authorised on any organisations you wish to access)
  • Idempotent

Out of Scope Features

  • Enabling any network services by default (instead enable them when needed)
  • Installing Homebrew formulae by default for everyone in an organisation (install them with Brewfiles in project repositories instead of mandating formulae for the whole organisation)
  • Opting-out of any macOS updates (Apple's security updates and macOS updates are there for a reason)
  • Disabling security features (these are a minimal set of best practises)
  • Add phone number to security screen message (want to avoid prompting users for information on installation)

Usage

Open https://strap.mikemcquaid.com/ in your web browser.

Instead, to run Strap locally run:

git clone https://github.com/MikeMcQuaid/strap
cd strap
bash bin/strap.sh # or bash bin/strap.sh --debug for more debugging output

Instead, to run the web application locally run:

git clone https://github.com/MikeMcQuaid/strap
cd strap
./script/bootstrap
GITHUB_KEY="..." GITHUB_SECRET="..." ./script/server

Strap is also available as a Docker image on Docker Hub (mikemcquaid/strap) and GitHub Packages (ghcr.io/mikemcquaid/strap).

Web Application Configuration Environment Variables

  • GITHUB_KEY (required in production): the GitHub.com Application Client ID.
  • GITHUB_SECRET (required in production): the GitHub.com Application Client Secret.
  • SESSION_SECRET (required in production): the secret used for cookie session storage.
  • WEB_CONCURRENCY (optional): the number of Puma (web server) threads to run (defaults to 3).
  • STRAP_ISSUES_URL (optional): the URL where users should file issues (defaults to no URL).
  • STRAP_BEFORE_INSTALL (optional): instructions displayed in the web application for users to follow before installing Strap (wrapped in <li> tags).
  • CUSTOM_HOMEBREW_TAP (optional): an optional Homebrew tap to install with brew tap. Specify multiple arguments to brew tap by separating values with spaces.
  • CUSTOM_BREW_COMMAND (optional): a single brew command that is run after all other stages have completed.

Status

Stable and in active development.

Contact

Mike McQuaid

License

Licensed under the MIT License. The full license text is available in LICENSE.txt.

Fork me on GitHub Retina Ribbons are vendored in app/assets/images and also licensed under the MIT License