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
class Hash | |
class Hash | |
def deep_transform_values(&block) | |
reduce({}) do |result, (k, v)| | |
result[k] = v.is_a?(Hash) ? v.deep_transform_values(&block) : yield(v) | |
result | |
end | |
end | |
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
Yeah. At the end of the day, ship the fucking thing! It's great to rewrite your code and make it cleaner and by the third time it'll actually be pretty. But that's not the point—you're not here to write code; you're here to ship products. | |
Peter Seibel, Coders at Work: Reflections on the Craft of Programming, pg. 22, loc. 522 | |
A lot of programmers have the instinct of, “You've got to present the error message!” No you don't. No one cares about that. That sort of stuff is a lot easier to manage in languages like Java that actually have an exception system. Where, at the top loop of your idle state, you just catch everything and you're done. No need to bother the user with telling them that some value was zero. | |
Peter Seibel, Coders at Work: Reflections on the Craft of Programming, pg. 32, loc. 702 | |
Are you trying to write good software or are you trying to be done by next week? You can't do both. | |
Peter Seibel, Coders at Work: Reflections on the Craft of Programming, pg. 34, loc. 743 | |
you want to arrange for ther |
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
Verifying my Blockstack ID is secured with the address 16X2WrRuC8uJ8FuH41CQuFxecK2xGAQPVp https://explorer.blockstack.org/address/16X2WrRuC8uJ8FuH41CQuFxecK2xGAQPVp |
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
SELECT | |
tmp.ipAddress, | |
-- Calculate how many connections are being held by this IP address. | |
COUNT( * ) AS numConnections, | |
-- For each connection, the TIME column represent how many SECONDS it has been in | |
-- its current state. Running some aggregates will give us a fuzzy picture of what | |
-- the connections from this IP address is doing. | |
FLOOR( AVG( tmp.time ) ) AS timeAVG, |
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
# Switch to Terraform version for this directory. | |
# Uses presence of .terraform-version file, or find in .tfstate if possible. | |
switchtf() { | |
if [ -f .terraform-version ]; then | |
version=`cat .terraform-version` | |
chtf $version | |
echo "Switched to Terraform $version." | |
else | |
version=`grep terraform_version .terraform/terraform.tfstate | sed -E 's/^ "terraform_version": "(.+)",$/\1/'` | |
if [ -n version ]; then |
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
services: | |
postgres: | |
image: postgis/postgis:10-2.5 | |
env: | |
# must specify password for PG Docker container image, see: https://registry.hub.docker.com/_/postgres?tab=description&page=1&name=10 | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: your_test_db_name | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck |
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
steps: | |
- name: Import DB seed data | |
run: psql -d postgresql://postgres@localhost/your_test_db_name -f your_seed_data.sql | |
working-directory: ./test/data | |
env: | |
PGPASSWORD: password |
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
steps: | |
- name: Test Go code | |
working-directory: ./go/somemodule | |
run: go test | |
env: | |
CI_DB_URL: postgresql://postgres:password@localhost:5432/your_test_db_name |
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
name: Test | |
on: | |
push: | |
paths: | |
- '.github/workflows/**' | |
- 'go/somemodule/**' | |
pull_request: | |
paths: | |
- '.github/workflows/**' | |
- 'go/somemodule/**' |
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
# Golang CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-go/ for more details | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version | |
- image: cimg/go:1.14 | |
environment: |