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
irb(main):008:0> roles = ['one', 'two'] | |
=> ["one", "two"] | |
irb(main):009:0> roles.include? 'one' && true | |
=> false | |
irb(main):010:0> roles.include? 'one' and true | |
=> true | |
irb(main):011:0> roles.include?('one') && true | |
=> true | |
irb(main):012:0> roles.include? true && 'one' | |
=> true |
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
irb(main):006:0> roles = ['one', 'two'] | |
=> ["one", "two"] | |
irb(main):007:0> roles.include? 'one' && true | |
=> false | |
irb(main):008:0> roles.include?('one') && true | |
=> true | |
irb(main):009:0> roles.include? 'one' and true | |
=> true |
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
from subprocess import Popen, PIPE | |
def shell_out(command): | |
return Popen(command.split(' '), stdout=PIPE,stderr=PIPE).communicate()[0].strip('\n').split('\n') | |
def main(): | |
return shell_out('echo one\ntwo\nthree\n') |
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
#!/usr/bin/env python | |
import requests | |
import sys | |
import time | |
import re | |
PAT = re.compile(r'^https?://(?:w{3}\.)?airbnb\..*/([^/]+)/?$') | |
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
#!/usr/bin/env python | |
import dateutil.parser | |
import socket | |
from time import mktime | |
import boto | |
GRAPHITE_KEY_TMPL='services.email.ses.%s.last15minutes' | |
GRAPHITE_HOST=('graphite.example.com', 2003) | |
def build_graphite_message_list(stats): |