- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
# An example of how to use AWS SNS with Python's boto | |
# By Stuart Myles @smyles | |
# http://aws.amazon.com/sns/ | |
# https://github.com/boto/boto | |
# | |
# Inspired by parts of the Ruby SWF SNS tutorial http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-sns-tutorial-implementing-activities-poller.html | |
# And the Python SNS code in http://blog.coredumped.org/2010/04/amazon-announces-simple-notification.html and http://awsadvent.tumblr.com/post/37531769345/simple-notification-service-sns | |
import boto.sns as sns | |
import json |
#!/usr/bin/env ruby | |
icon_list = "alligator, anteater, armadillo, auroch, axolotl, badger, bat, beaver, buffalo, camel, chameleon, cheetah, chipmunk, chinchilla, chupacabra, cormorant, coyote, crow, dingo, dinosaur, dolphin, duck, elephant, ferret, fox, frog, giraffe, gopher, grizzly, hedgehog, hippo, hyena, jackal, ibex, ifrit, iguana, koala, kraken, lemur, leopard, liger, llama, manatee, mink, monkey, narwhal, nyan cat, orangutan, otter, panda, penguin, platypus, python, pumpkin, quagga, rabbit, raccoon, rhino, sheep, shrew, skunk, slow loris, squirrel, turtle, walrus, wolf, wolverine, wombat" | |
for icon in icon_list.split ', ' do | |
element = icon.sub ' ', '' | |
`curl https://ssl.gstatic.com/docs/common/profile/#{element}_lg.png -o icons/#{element}.png` | |
end |
default_app_config = 'myapp.auth.apps.MyAuthAppConfig' |
"""Python implementation of Conway's Game of Life | |
Somewhat inspired by Jack Diederich's talk `Stop Writing Classes` | |
http://pyvideo.org/video/880/stop-writing-classes | |
Ironically, as I extended the functionality of this module it seems obvious | |
that the next step would be to refactor board into a class with advance and | |
constrain as methods and print_board as __str__. | |
""" |
# ---- Base python ---- | |
FROM python:3.6 AS base | |
# Create app directory | |
WORKDIR /app | |
# ---- Dependencies ---- | |
FROM base AS dependencies | |
COPY gunicorn_app/requirements.txt ./ | |
# install app dependencies | |
RUN pip install -r requirements.txt |
#!/usr/bin/env/python | |
# | |
# More of a reference of using jinaj2 without actual template files. | |
# This is great for a simple output transformation to standard out. | |
# | |
# Of course you will need to "sudo pip install jinja2" first! | |
# | |
# I like to refer to the following to remember how to use jinja2 :) | |
# http://jinja.pocoo.org/docs/templates/ | |
# |
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups
command.
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe
Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
import turtle | |
turtle.pensize(3) | |
def draw_heart_curve(): | |
for i in range(200): | |
turtle.right(1) | |
turtle.forward(1) | |
turtle.color("pink", "pink") |
from airflow.hooks.postgres_hook import PostgresHook | |
from airflow.models import BaseOperator | |
from airflow.utils.decorators import apply_defaults | |
from datetime import datetime, timedelta | |
from os import environ | |
import csv | |
class DataSourceToCsvOperator(BaseOperator): | |
""" |