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
# methods defined on main:Object | |
def iron(array) | |
a = [] | |
array.each do |element| | |
if element.is_a? Array | |
a.push(*iron(element)) | |
else | |
a.append(element) | |
end | |
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
require 'date' | |
require 'set' | |
def normalize_requests(requests) | |
start_work = DateTime.strptime('8', '%H').to_time | |
end_work = DateTime.strptime('17', '%H').to_time | |
requests = requests.map do |c| | |
c = c.split(',') | |
tp = [DateTime.strptime(c.first, '%H:%M%P').to_time, c.last.strip.to_i] |
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
############################## | |
## POSTGRESQL BACKUP CONFIG ## | |
############################## | |
# Optional system user to run backups as. If the user the script is running as doesn't match this | |
# the script terminates. Leave blank to skip check. | |
BACKUP_USER=postgres | |
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified. | |
HOSTNAME=localhost |
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
############################## | |
## POSTGRESQL BACKUP CONFIG ## | |
############################## | |
# Optional system user to run backups as. If the user the script is running as doesn't match this | |
# the script terminates. Leave blank to skip check. | |
BACKUP_USER=postgres | |
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified. | |
HOSTNAME=localhost |
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 | |
# GIT_DIR isn't set for all hook events. Read this as GIT_DIR ||= | |
export GIT_DIR="${GIT_DIR-$(dirname "$(dirname "${BASH_SOURCE[0]}")")}" | |
if [[ -p /dev/fd/0 ]]; then # Check if STDIN is a pipe (i.e. we're getting input from Git) | |
INPUT=$(</dev/stdin) | |
fi | |
while read -r hook; do | |
if [[ -z "${INPUT+x}" ]]; then | |
"${hook}" "$@" |