This file contains hidden or 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 sh | |
## | |
# Notes: | |
# Log line: | |
# REPORT RequestId: f420d819-d07e-11e8-9ef2-4d8f649fd167 Duration: 158.15 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 38 MB | |
# [ report_label="REPORT", ..., label="Used:", max_memory_used_value, unit="MB" ] | |
# | |
# Test the metric filter | |
# aws logs test-metric-filter \ |
This file contains hidden or 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
""" Quick example showing how to do a bulk update into the database | |
using SQLAlchemy, without interacting heavily with the ORM. | |
""" | |
from sqlalchemy.sql.expression import bindparam | |
stmt = addresses.update().\ | |
where(addresses.c.id == bindparam('_id')).\ | |
values({ | |
'user_id': bindparam('user_id'), | |
'email_address': bindparam('email_address'), |
This file contains hidden or 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
Building with Confidence | |
- Investment into quality i.e. spending time improving infrastructure, refactoring code, looking for better solutions (CRITICAL) | |
- Once a week half a day bug hunt with dev team or full-time Automated QA Engineer | |
- Demanding and giving developers time to do proper testing of their own effort. | |
- Test-driven development (or BDD) and Continuous Integration | |
- Code reviews | |
- Investment into writing library-style code | |
Running Tight Ship | |
- Pre-planning meeting where the dev teams play "Planning poker" (CRITICAL) |
This file contains hidden or 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
# coding: utf-8 | |
""" | |
Cauê Thenório - cauelt(at)gmail.com | |
This snippet makes Django do not create URL languages prefix (i.e. /en/) | |
for the default language (settings.LANGUAGE_CODE). | |
It also provides a middleware that activates the language based only on the URL. | |
This middleware ignores user session data, cookie and 'Accept-Language' HTTP header. |
This file contains hidden or 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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |