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
# Gemfile | |
gem 'kramdown' |
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
require "benchmark" | |
include Benchmark | |
n = 100_000_000 | |
def while_loop(n = 100_000_000) | |
i = 0 | |
s = 0 | |
while i <= n |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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 'yaml' | |
if Gem::Version.new(Psych::LIBYAML_VERSION) < Gem::Version.new('0.2.5') | |
warn "Your libyaml library is outdated: please upgrade to >= 0.2.5.\n" \ | |
"The generated YAML will include output trailing spaces for empty scalar nodes, whereas " \ | |
"Phrase doesn't include them." | |
end | |
# Method to "deep sort" keys in a Hash (i.e. recursively), the way that Phrase would do. |
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
# .github/workflows/02-merge-phrase-branch-in-to-phrase-main.yml | |
name: "Locales : Replicate git merge in phrase.com" | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
paths: |
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
# .github/workflows/01-create-phrase-branch.yml | |
name: "Locales : Create or Update phrase.com (branch)" | |
on: | |
push: | |
branches-ignore: | |
- main | |
- staging | |
- 'auto-phrase-sync-*' | |
paths: |
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
# .phrase.yml | |
phrase: | |
access_token: YOUR_ACCESS_TOKEN | |
project_id: YOUR_PROJECT_ID | |
push: | |
sources: | |
- file: ./config/locales/<locale_name>.yml | |
params: | |
file_format: yml |
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
# .github/workflows/03-pull-phrase-to-github.yml | |
name: "Locales : Phrase pull on main branch" | |
on: | |
workflow_dispatch: # This will allow us to execute this github workflow manually whenever we want. | |
schedule: | |
- cron: '0 7 * * 1,2,3,4,5' | |
jobs: | |
build: | |
name: "Phrase : Sync Phrase with Github (main branch)" |
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
# Use TDD principles to build out name functionality for a Person. | |
# Here are the requirements: | |
# - Add a method to return the full name as a string. A full name includes | |
# first, middle, and last name. If the middle name is missing, there shouldn't | |
# have extra spaces. | |
# - Add a method to return a full name with a middle initial. If the middle name | |
# is missing, there shouldn't be extra spaces or a period. | |
# - Add a method to return all initials. If the middle name is missing, the | |
# initials should only have two characters. | |
# |
OlderNewer