Skip to content

Instantly share code, notes, and snippets.

View brendonrapp's full-sized avatar

Brendon Rapp brendonrapp

View GitHub Profile
@geovannimp
geovannimp / cSpell_packageJson_dictionary.md
Last active May 8, 2024 23:21
cSpell package.json dictionary

cSpell package.json dictionary with monorepo support

Create the following files in the .vscode folder of your repo

.vscode/cspell.json

{
  "import": ["./cspell-node.config.cjs"]
}

.vscode/cspell-node.config.cjs

@kurahaupo
kurahaupo / TrueColour.md
Last active May 9, 2024 11:25 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 million)
@jaketf
jaketf / run_relevant_pre_cloudbuilds.sh
Last active August 1, 2023 17:00
Run nested cloud build files if any diff in it's directory tree
#!/bin/bash
###############################################################################################################
# UPDATE: #
# This has been merged to a more complete example: #
# https://github.com/jaketf/ci-cd-for-data-processing-workflow/blob/master/helpers/run_relevant_cloudbuilds.sh#
###############################################################################################################
@katyhuff
katyhuff / pr-checklist.md
Last active April 26, 2024 06:22
Pull Request Review Checklist
  • Read the PR description
  • Read through all the changes, considering the following questions.
    • Is there anything you can praise about this PR? Start with praise.
    • Are variable names brief but descriptive?
    • Are new/changed functions no longer than a paragraph?
    • Do all function parameters have default values where appropriate?
    • Is the code clear and clean? (see Robert C. Martin's Clean Code)
    • Is there enough documentation?
  • Does the programming style meet the requirements of the repository (PEP8 for python, google for c++, etc.)
@kinoute
kinoute / .Dockerfile
Last active March 28, 2024 04:44
Example of Ruby on Rails 6 Multi-stage builds with Docker. Development/production environments share the same Dockerfile.
FROM ruby:2.7.1-slim AS base
LABEL maintainer="Yann Defretin <yann@defret.in"
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
--no-install-recommends \
build-essential=12.6 \
gnupg2=2.2.12-1+deb10u1 \

Overview

Cloud Build

Cloud Build is a product of GCP (Google Cloud Platform) used to build software quickly across all languages.

Function:

  • Speed up Build with VMs on Cloud without wasting personal computer’s resources.
  • Source code put on Local, Github, Cloud Source Repositories or Bitbucket all can use Cloud Build.
  • Package your source into Docker containers or non-container artifacts with build tools such as Maven, Gradle, webpack, Go, or Bazel.
  • After completing Build, the result is updated on Docker Hub or Container Registry.
  • You can be flexible to adjust the stream of Build process according to your intention.
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active July 3, 2023 05:25
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@randallreedjr
randallreedjr / heroku-remote.md
Last active April 25, 2024 07:06
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@krisf
krisf / enc
Last active August 13, 2022 00:02
decrypts OpenSSL encrypted files from ruby Backup gem
#!/bin/bash
#encrypt files with aes-256-cbc cipher using openssl
#install:
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc
# sudo chmod +x /usr/bin/enc
# enc --help
#encrypt files
if [ $1 == "-e" ];
then
@ngocphamm
ngocphamm / Homebrew Zsh on Mac
Last active April 29, 2024 04:41
Notes on using Homebrew Zsh as default login shell
1. Install Zsh with Homebrew
brew install zsh
2. Add "/usr/local/bin/zsh" to "/etc/shells" file
sudo vim /etc/shells
3. Change to default login shell
chsh -s /usr/local/bin/zsh $USER
4. Make sure new version of Zsh is in active