This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PrettyString.new('something').blue | |
# PrettyString.new('something').red | |
# PrettyString.new('something').green | |
# PrettyString.new('something').yellow | |
# PrettyString.new('something').magenta | |
# PrettyString.new('something').white | |
class PrettyString < String | |
# https://no-color.org/ | |
NO_COLOR = ENV.key?('NO_COLOR') || `tput colors`.chomp.to_i < 8 | |
ANSI_COLORS = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A nice way to add color to strings | |
class PrettyString < String | |
# https://no-color.org/ | |
NO_COLOR = ENV.key?('NO_COLOR') || `tput colors`.chomp.to_i < 8 | |
ANSI_COLORS = { | |
white: 0, | |
red: 31, | |
green: 32, | |
yellow: 33, | |
blue: 34, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Instructions: | |
# | |
# This script is a Git pre-commit hook that spell checks any content you are about to commit. | |
# | |
# Place this script into the ".git/hooks/" directory in your repository. It must be called "pre-commit" and be | |
# executable. A Git hook only works in a single repository. You need to copy this hook into every repository you wish to | |
# use it in manually. Optionally, you can set up a symlink in the ".git/hooks/" directory pointing to the script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Choose a version of Ruby | |
FROM ruby:2.7.3-slim | |
ARG APP_NAME=lentille | |
ARG BUNDLER_ARGS | |
ARG BUNDLE_WITH | |
ARG BUNDLE_WITHOUT | |
ARG BUNDLE_DEPLOYMENT | |
ENV APP_NAME=${APP_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require 'json' | |
require 'pry' | |
def files | |
@files ||= begin | |
`git diff --staged --name-only --cached`.split("\n").reject do |file| | |
!File.exists?(file) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class ExampleStatusParser | |
def self.parse(string) | |
new(string).parse | |
end | |
def initialize(string) | |
@header_line, _, *@row_lines = string.lines.to_a | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'open-uri' | |
require 'tempfile' | |
require File.expand_path('ruby_bash', __dir__).to_s | |
options = {} | |
parser = OptionParser.new do |opts| | |
opts.banner = 'Usage: replicate gem inabox' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
backtrace: false | |
bulk_threshold: 1000 | |
sources: | |
- https://gems.rubyforge.org/ | |
- https://rubygems.org/ | |
update_sources: true | |
verbose: true | |
concurrent_downloads: 8 | |
gem: --no-document |