Skip to content

Instantly share code, notes, and snippets.

View carlosagp's full-sized avatar

Carlos Garcia carlosagp

  • Salt Lake Valley
View GitHub Profile

Private Gem Heroku

  1. Generate an OAuth token from GitHub

You only need to check the repo scope when configuring the token permissions

  1. Update Gemfile to use your private repository

gem 'private_repo', git: 'https://github.com/username/private_repo.git' 3. Configure bundler with your OAuth token

@covard
covard / pre-commit.md
Last active March 5, 2024 20:38
Git pre commit hook to prevent language and committing to certain branches

Git Pre Commit Hook

This will prevent you from commiting any debug statements or swear words or commit to the wrong branch. After adding this file to the .git/hooks/pre-commit file then you will need to do the following:

Global / Repo Specific (2 options)


Option 1: Global

@subfuzion
subfuzion / curl.md
Last active November 17, 2024 03:54
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mlanett
mlanett / rails http status codes
Last active November 4, 2024 18:04
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@harlow
harlow / user.rb
Last active November 16, 2023 15:13
Extract a validator in Rails. Zip code validation.
# app/models/user.rb
class User < ActiveRecord::Base
validates :zip_code, presence: true, zip_code: true
end