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 CodableCSV | |
extension VillaMarket{ | |
static func getOnlineCsv()async throws ->[Item]{ | |
let url = URL(string: "https://url/item.csv")! | |
let (data, _) = try await URLSession.shared.data(from: url) | |
let decoder = CSVDecoder{ | |
$0.bufferingStrategy = .sequential |
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 json | |
with open('/content/drive/MyDrive/example.json', 'w') as f: | |
json.dump({'key':'xxx','secret':'xxx'}, f) |
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
s3 = boto3.client('s3', aws_access_key_id='xxx', aws_secret_access_key='xxx') |
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
sudo apt update --allow-releaseinfo-change |
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
dt = parser.parse('2021-08-07T02:00:00.000Z') | |
datestamp(dt, timezone(timedelta(hours=7))) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 aws_requests_auth.boto_utils import BotoAWSRequestsAuth | |
auth = BotoAWSRequestsAuth(aws_host='api.example.com', | |
aws_region='us-east-1', | |
aws_service='execute-api') | |
import requests | |
response = requests.post('https://api.example.com/test', json={"foo": "bar"}, auth=auth) |
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
#put in your TABLENAME var and use Supermodel from [nichelper](https://thanakijwanavit.github.io/nicHelper/) | |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
general table tample for general use by nested app | |
Parameters: | |
TABLENAME: |
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 | |
KEYTABLE = os.environ.get('KEYTABLE') | |
# Cell | |
from pynamodb.models import Model | |
from pynamodb.attributes import UnicodeAttribute, NumberAttribute | |
from awsSchema.apigateway import Event, Response | |
from datetime import datetime | |
from nicHelper.schema import validateUrl | |
from jsonschema import ValidationError |
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
name: Remove old artifacts | |
on: push | |
jobs: | |
remove-old-artifacts: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: |