-
Create a new issue on GitHub.
-
Drag-and-drop an image onto the comment field.
-
Wait for the upload process to finish.
-
Copy the URL and use it in your Markdown files on GitHub.
This file contains hidden or 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 | |
| import re | |
| import boto3 | |
| import zipfile | |
| def parse_s3_uri(url): | |
| match = re.search('^s3://([^/]+)/(.+)', url) | |
| if match: | |
| return match.group(1), match.group(2) |
import boto3
client = boto3.client('glue')
response = client.create_crawler(
Name='SalesCSVCrawler',
Role='AWSGlueServiceRoleDefault',
DatabaseName='sales-cvs',
Description='Crawler for generated Sales schema',
This file contains hidden or 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
| { | |
| "text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...", | |
| "truncated": true, | |
| "in_reply_to_user_id": null, | |
| "in_reply_to_status_id": null, | |
| "favorited": false, | |
| "source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>", | |
| "in_reply_to_screen_name": null, | |
| "in_reply_to_status_id_str": null, | |
| "id_str": "54691802283900928", |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
This file contains hidden or 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
| # http://dabeaz.blogspot.mk/2010/02/context-manager-for-timing-benchmarks.html | |
| import time | |
| class benchmark(object): | |
| def __init__(self,name): | |
| self.name = name | |
| def __enter__(self): | |
| self.start = time.time() | |
| def __exit__(self,ty,val,tb): | |
| end = time.time() | |
| print("%s : %0.3f seconds" % (self.name, end-self.start)) |
This file contains hidden or 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 | |
| from boto3.session import Session | |
| def assume_role(arn, session_name): | |
| """aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role""" | |
| client = boto3.client('sts') | |
| account_id = client.get_caller_identity()["Account"] | |
| print(account_id) |