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 sys | |
# 重命名当前文件夹下的所有文件。 | |
path = os.path.dirname(os.path.realpath(__file__)) | |
print(path) | |
onlyfiles = [ | |
f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and not f.startswith(".") | |
] |
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
"python.formatting.provider": "black", | |
"python.formatting.blackArgs": [ | |
"--skip-string-normalization" | |
] |
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 boto3.dynamodb.types import TypeDeserializer, TypeSerializer | |
def from_dynamodb_to_json(item): | |
d = TypeDeserializer() | |
return {k: d.deserialize(value=v) for k, v in item.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 json | |
import boto3 | |
session = boto3.Session(profile_name="PROFILE NAME") | |
ddb_client = session.client("dynamodb") | |
table_name = 'Main-nhdgaeyblfgp3gygkcsjpmxvky-dev' | |
challenge_id = '0df3b39d-acb6-4fc9-a3cd-eebf29c8b958' | |
response = ddb_client.get_item( |
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
{ | |
"python.formatting.provider": "yapf", | |
"python.formatting.yapfArgs": [ | |
"--style", | |
"{column_limit: 200}" | |
], | |
} |
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
string=$(adb devices | egrep ".*device$") | |
devices=(${string//device/}) | |
echo "检测到${#devices[@]}台设备连接" | |
for ((i = 0; i < ${#devices[*]}; i++)); do | |
echo "$(($i + 1)). ${devices[i]} : $(adb -s ${devices[i]} shell getprop ro.product.model)" | |
done | |
if [ ${#devices[@]} -gt 0 ]; then | |
echo "输入要操作的设备编号:" | |
read num |
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
findDevices() { | |
string=$(adb devices | egrep ".*device$") | |
if [ $? -eq 0 ]; then | |
devices=(${string//device/}) | |
time=$(date "+%Y-%m-%d %H:%M:%S") | |
echo "$time 检测到${#devices[*]}台设备" | |
for d in ${devices[@]}; do | |
echo "$d : $(adb -s $d shell getprop ro.product.model)" | |
done | |
return ${#devices[*]} |
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 re, os, sys, time, datetime | |
class AutoScroll(object): | |
def __init__(self): | |
self.devices = [] | |
self.count = 0 | |
def find_devices(self): | |
data = os.popen("adb devices").readlines() |
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
""" | |
Amazon Gift Card | |
官网网页测试地址: | |
https://s3.amazonaws.com/AGCOD/htmlSDKv2/htmlSDKv2_NAEUFE/index.html | |
可对参数进行逐一对照。 | |
官网API文档: | |
Amazon Gift Card Incentives API:https://developer.amazon.com/zh/docs/incentives-api/incentives-api.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
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# This file is licensed under the Apache License, Version 2.0 (the "License"). | |
# You may not use this file except in compliance with the License. A copy of the | |
# License is located at | |
# | |
# http://aws.amazon.com/apache2.0/ | |
# | |
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
# OF ANY KIND, either express or implied. See the License for the specific |
NewerOlder