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
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.sql.*; | |
public class PrestoJDBC { | |
// JDBC driver name and database URL | |
static final String JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver"; | |
//static final String JDBC_DRIVER = "com.teradata.presto.jdbc42.Driver"; | |
static final String DB_URL = "jdbc:presto://ec2-xx-xx-xxx-xxx.ap-northeast-1.compute.amazonaws.com:8889/hive/default"; |
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
enum EnumType:Any { | |
case none | |
case firstType(value:String) | |
case secondTypeA(value1:String, value2:Int) | |
case secondTypeB(value1:String, value2:Int) | |
} | |
func checkEnumType(type:EnumType) { | |
switch type { |
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
disabled_rules: # rule identifiers to exclude from running | |
- line_length | |
- function_body_length | |
- cyclomatic_complexity | |
- multiple_closures_with_trailing_closure | |
- xctfail_message | |
# Swift 3 rules that do not make sense for Swift 2.3 | |
- implicit_getter |
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
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds.""" | |
""" Distributed under the BSD license here.""" | |
__name__ = "PyRSS2Gen" | |
__version__ = (1, 1, 0) | |
__author__ = "Andrew Dalke <[email protected]>" | |
_generator_name = __name__ + "-" + ".".join(map(str, __version__)) | |
import datetime |
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 python3 | |
# Demonstrates the use of Python to work with Cognito. | |
# Create a new a user, log in, check tokens and call an API. | |
# The purpose was to learn about Cognito. Security has been | |
# circumvented in the interest of keeping it simple. | |
# Notably, the authentication procedure uses the most insecure | |
# method. This code is not intended for use in production. | |
# | |
# https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html |
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
import os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
region_name = os.environ['AWS_REGION'] | |
if event: | |
sqs = boto3.client('sqs', region_name=region_name) | |
queue_name = event['Records'][0]['eventSourceARN'].split(':')[-1] | |
queue_url = sqs.get_queue_url( |
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
import os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
region_name = os.environ['AWS_REGION'] | |
if event: | |
sqs = boto3.resource('sqs', region_name=region_name) | |
queue_name = event['Records'][0]['eventSourceARN'].split(':')[-1] | |
queue = sqs.get_queue_by_name(QueueName=queue_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
import os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
if event: | |
messages_to_reprocess = [] | |
batch_failure_response = {} | |
for record in event["Records"]: | |
try: |