See https://gist.github.com/stilist/dd88f71557c5231d374ce36645a065de for previous context.
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
diff --git a/config/initializers/model_extensions.rb b/config/initializers/model_extensions.rb | |
new file mode 100644 | |
index 000000000..2db532ba9 | |
--- /dev/null | |
+++ b/config/initializers/model_extensions.rb | |
@@ -0,0 +1 @@ | |
+require "blog_extension" | |
diff --git a/lib/blog_extension.rb b/lib/blog_extension.rb | |
new file mode 100644 | |
index 000000000..01fbcf5b3 |
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 bash | |
set -euo pipefail | |
destination_branch_name="${1:-merge-pile}" | |
branch_list="${2:-branch-list.txt}" | |
if [[ ! -f "${branch_list}" ]] ; then | |
echo "ERROR: Branch list file (${branch_list}) doesn't exist" >&2 | |
exit 1 |
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 -euo pipefail | |
log_directory="${1:-/var/log}" | |
year="20[[:digit:]]{2}" | |
day="[[:digit:]]{2}" | |
month_num="[[:digit:]]{1,2}" | |
month_alpha="[[:upper:]][[:lower:]]{2}" |
This is a small revision to the move_cursor_to_start_of_ps1
function described in ‘When did I run that command?’. The original relies on a specific number of lines in PS1
; this works with an arbitrary number of lines.
The original code works correctly for the PS1
provided in the article, but my PS1
has an additional line, and I wanted to avoid using a magic number in case I change my PS1
in the future.
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
// You can run this from your browser's JavaScript console. | |
console.log(JSON.stringify(Array.from(document.querySelectorAll('.retableRow')).map(node => { | |
let rating | |
const stars = node.querySelectorAll('.rating .personal') | |
if (stars.length) { | |
rating = stars.length | |
} else { | |
rating = node.querySelector('.rated-up') ? 'up' : 'down' | |
} |
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
// Copyright 2018 Jordan Cole | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to | |
// deal in the Software without restriction, including without limitation the | |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
// sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
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 'fileutils' | |
require 'json' | |
# LOG = ARGF.read.freeze | |
LOG = File.read('log.txt') | |
COMMIT_PATTERN = / | |
\A | |
r(?<revision>\d+) | |
\s\|\s |
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
MIT License | |
Copyright (c) 2017-present Jordan Cole | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
Copyright (c) 2017 Jordan Cole | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O |
NewerOlder