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
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
Prefix: | |
Type: String | |
VPCCIDR: | |
Type: String | |
Default: 10.0.0.0/16 | |
AllowedPattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' |
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
boto3.resource('dynamodb') | |
# Decode DynamoDB response to python | |
deserializer = boto3.dynamodb.types.TypeDeserializer() | |
data = {k: deserializer.deserialize(v) for k,v in low_level.items()} | |
# Encode python to DynamoDb low level format | |
serializer = boto3.dynamodb.types.TypeSerializer() | |
low_level = {k: serializer.serialize(v) for k,v in data.items()} |
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 textwrap | |
from epub_conversion.utils import convert_epub_to_lines, convert_lines_to_text, open_book | |
import boto3 | |
from contextlib import closing | |
from pydub import AudioSegment | |
import os | |
def split_epub(book_name): | |
book = open_book(book_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
using Amazon.SimpleSystemsManagement; | |
using Amazon.SimpleSystemsManagement.Model; | |
using System.Threading.Tasks; | |
namespace AWSParameterStore | |
{ | |
public class ParameterAWSStore | |
{ | |
private static readonly string databaseString = "DATABASE_HOST"; | |
private static readonly string databaseName = "DATABASE_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 boto3 | |
import hashlib | |
sqs = boto3.resource('sqs', region_name='eu-west-1') | |
queue_name = 'FifoQueue.fifo' | |
# tworzymy kolejkę wiadomości FIFO | |
queue_create = sqs.create_queue(QueueName=queue_name, Attributes={'FifoQueue':'true', 'ContentBasedDeduplication': 'true'}) | |
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
from azure.storage.queue import QueueService | |
# tworzymy usługę | |
queue_service = QueueService(account_name='nazwa konta', account_key='klucz api') | |
# tworzymy kolejkę | |
queue_service.create_queue('testqueue') | |
# wysyłamy jedną wiadomość, która zniknie po 30 sekundach | |
# queue_service.put_message('testqueue', 'Moja pierwsza wiadomość', 0, 30, 30) |
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
+(NSDictionary *) getCurrentNetwork | |
{ | |
NSMutableDictionary *_hn; | |
NSArray *netArray = (__bridge_transfer id)CNCopySupportedInterfaces(); | |
id info = nil; | |
for (NSString *netName in netArray) | |
{ | |
info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)netName); | |
NSDictionary *infoDictionary = (NSDictionary*) info; |