Skip to content

Instantly share code, notes, and snippets.

View Merovex's full-sized avatar

Ben W Merovex

  • Gainfully Employed
  • In a hidden bunker under a non-descript building
  • 07:41 (UTC -04:00)
View GitHub Profile
@Merovex
Merovex / Commit Formatting.md
Created July 11, 2019 21:58 — forked from brianclements/Commit Formatting.md
Angular Commit Format Reference Sheet

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the AngularJS change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@Merovex
Merovex / _contrast.scss
Last active December 22, 2019 19:22
Ensures color contrast for Accessibility, with decent granularity.
@function pow($base, $exponents) {
$raised: 1;
@for $i from 1 through $exponents {
$raised: $raised * $base;
}
@return $raised;
}
@function luma($color){
// Thanks voxpelli for a very concise implementation of luminance measure in sass
// Adapted from: https://gist.github.com/voxpelli/6304812
export default function parseToMarkdown(chunk) {
let children = !chunk.type
? chunk.text
: chunk.children.map(c => parseToMarkdown({ ...c, parentType: chunk.type })).join('');
if (children === '') return;
// formatting
if (chunk.bold) {
children = `**${children.trim()}** `;
{
"extensions.showRecommendationsOnlyOnDemand": true,
"editor.tabSize": 2,
"editor.renderWhitespace": "boundary",
"editor.wordWrap": "wordWrapColumn",
"editor.mouseWheelZoom": true,
"editor.tabCompletion": "on",
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
"editor.fontSize": 16,
"editor.fontWeight": "400",
@Merovex
Merovex / create_toc.rb
Created August 2, 2020 14:36
Ruby Table of Contents generator for Markdown file in 6 lines
puts "\nCreating Table of Contents"
# This TOC generator assumes you don't care to include the page header
toc = "## Contents\n\n" + content.scan(/^##\s?(.*)\n/iu).flatten.map do |header|
next if header == 'Contents'
indent = " " * header.count("#")
anchor = header.downcase.gsub(/\W+/,'-').chomp('-')
"%s* [%s](#%s)\n" % [indent,header,anchor]
end.join
@function pow($base, $exponents) {
$raised: 1;
@for $i from 1 through $exponents {
$raised: $raised * $base;
}
@return $raised;
}
@function luma($color){
// Thanks voxpelli for a very concise implementation of luminance measure in sass
// Adapted from: https://gist.github.com/voxpelli/6304812
@Merovex
Merovex / font-family-serif.scss
Last active September 30, 2020 11:48
Baseline the Serif font to the OS defaults, similar to what is used in Bootstrap's Reboot (same mix seen in dozens of websites using serif in body.
// font-family: Cambria, Georgia, "Times New Roman", Times, serif;
// Noto Serif found on modern Android and many Linux distros.
// Times is Mac OS
// Georgia is a classic serif font that I have seen leading this everywhere.
$font-family-sans-serif: Cambria, Georgia, "Noto Serif", "Times New Roman", Times, serif;
CREATE TABLE `states` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@Merovex
Merovex / Gemfile
Created January 24, 2021 04:02 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@Merovex
Merovex / Gemfile
Created January 24, 2021 04:02 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers