<commit_before>#!/bin/bash

set -e

# We assume the current year (and also assume bash 3, because macs)
read -p "Enter your event year (default: $(date +"%Y")): " year
[ -z "${year}" ] && year='2016'

# We don't use accent marks or spaces or other special characters in city names
read -p "Enter your city name: " city
cityabbr=$(echo $city | tr -dc '[:alpha:]' | tr 'āáǎàēéěèīíǐìōóǒòöūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ' 'aaaaeeeeiiiiooooouuuuuuuuAAAAEEEEIIIIOOOOUUUUUUUU' | tr '[:upper:]' '[:lower:]')

read -p "Enter your devopsdays event twitter handle (defaults to devopsdays): " twitter
[ -z "${twitter}" ] && twitter='devopsdays'
# remove @ if they added it
twitter=$(echo $twitter | tr -dc '[:alnum:]')

# We use the term event_slug in the hugo files too
event_slug=$year-$cityabbr


cp yyyy-city.yml data/events/$event_slug.yml
sed -i '' "s/YYYY/$year/" data/events/$event_slug.yml
sed -i '' "s/City/$city/" data/events/$event_slug.yml
sed -i '' "s/yourlocation/$city/" data/events/$event_slug.yml
sed -i '' "s/yyyy-city/$event_slug/" data/events/$event_slug.yml
sed -i '' "s/city-year/$cityabbr-$year/" data/events/$event_slug.yml

cp -r content/events/sample-event content/events/$event_slug

# The draft = true in the frontmatter is what prevents the sample event from showing on the site
# don't need the double quotes because there's no variable in the substitution
sed -i '' '/draft = true/d' content/events/$event_slug/*

# setting the creation date at the time the event is instantiated
datestamp=$(date +%Y-%m-%dT:%H:%M:%S:%z)
sed -i '' "s/2000-01-01T01:01:01-06:00/$datestamp/" content/events/$event_slug/*

sed -i '' "s/YYYY-city/$event_slug/" content/events/$event_slug/welcome.md
sed -i '' "s/devopsdaysyourtown/$twitter/" content/events/$event_slug/welcome.md
<commit_msg>Too many colons, and timezone weirdness in go<commit_after>#!/bin/bash

set -e

# We assume the current year (and also assume bash 3, because macs)
read -p "Enter your event year (default: $(date +"%Y")): " year
[ -z "${year}" ] && year='2016'

# We don't use accent marks or spaces or other special characters in city names
read -p "Enter your city name: " city
cityabbr=$(echo $city | tr -dc '[:alpha:]' | tr 'āáǎàēéěèīíǐìōóǒòöūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ' 'aaaaeeeeiiiiooooouuuuuuuuAAAAEEEEIIIIOOOOUUUUUUUU' | tr '[:upper:]' '[:lower:]')

read -p "Enter your devopsdays event twitter handle (defaults to devopsdays): " twitter
[ -z "${twitter}" ] && twitter='devopsdays'
# remove @ if they added it
twitter=$(echo $twitter | tr -dc '[:alnum:]')

# We use the term event_slug in the hugo files too
event_slug=$year-$cityabbr


cp yyyy-city.yml data/events/$event_slug.yml
sed -i '' "s/YYYY/$year/" data/events/$event_slug.yml
sed -i '' "s/City/$city/" data/events/$event_slug.yml
sed -i '' "s/yourlocation/$city/" data/events/$event_slug.yml
sed -i '' "s/yyyy-city/$event_slug/" data/events/$event_slug.yml
sed -i '' "s/city-year/$cityabbr-$year/" data/events/$event_slug.yml

cp -r content/events/sample-event content/events/$event_slug

# The draft = true in the frontmatter is what prevents the sample event from showing on the site
# don't need the double quotes because there's no variable in the substitution
sed -i '' '/draft = true/d' content/events/$event_slug/*

# setting the creation date at the time the event is instantiated
datestamp=$(date +%Y-%m-%dT%H:%M:%S%z | sed 's/^\(.\{22\}\)/\1:/')
sed -i '' "s/2000-01-01T01:01:01-06:00/$datestamp/" content/events/$event_slug/*

sed -i '' "s/YYYY-city/$event_slug/" content/events/$event_slug/welcome.md
sed -i '' "s/devopsdaysyourtown/$twitter/" content/events/$event_slug/welcome.md

{'fraction_non_alphanumeric': 0.1600768808347062, 'fraction_numerical': 0.013454146073585941, 'mean_word_length': 4.5196969696969695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7202643', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1391, 'n_words': 373}