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
public async Task<IActionResult> Upload([FromServices] IAmazonS3 s3) | |
{ | |
await new TransferUtility(s3) | |
.UploadAsync(source, "my-bucket", "some/path/image.jpg"); | |
return Ok(); | |
} |
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
services | |
.AddSingleton<IAmazonS3>(p => { | |
var config = new AmazonS3Config | |
{ | |
RegionEndpoint = RegionEndpoint.USWest2, | |
}; | |
if (p.GetService<IHostEnvironment>().IsDevelopment()) | |
{ | |
config.ForcePathStyle = true; | |
config.ServiceURL = options.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
if (p.GetService<IHostEnvironment>().IsDevelopment()) | |
{ | |
config.ForcePathStyle = true; | |
config.ServiceURL = "http://localhost:4566"; | |
} |
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
services | |
.AddSingleton<IAmazonS3>(p => { | |
var config = new AmazonS3Config | |
{ | |
RegionEndpoint = RegionEndpoint.USWest2, | |
}; | |
return new AmazonS3Client(myAccessKey, mySecret, config); | |
}); |
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
version: '3.2' | |
services: | |
localstack: | |
image: localstack/localstack:latest | |
container_name: localstack | |
ports: | |
- 4566:4566 | |
environment: | |
- SERVICES=s3 | |
- DEBUG=1 |
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
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- task: sfpwowerscript-installsfdx-task@5 | |
displayName: Install SFDX |
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
$ ls -lh ~/nostalgia_data | |
total 140K | |
-rw-r--r-- 1 root root 0 Feb 17 09:26 __init__.py | |
drwxr-xr-x 3 root root 96 Feb 16 07:34 __pycache__ | |
drwxr-xr-x 4 root root 128 Feb 17 11:00 cache | |
dr-------- 2 root root 64 Feb 17 09:32 dfs | |
drwxr-xr-x 467 root root 15K Feb 17 20:29 html | |
-rw-r--r-- 1 root root 112K Feb 17 20:29 meta.jsonl | |
-rw-r--r-- 1 root root 154 Feb 16 07:18 nostalgia_entry.py |
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
global: | |
scrape_interval: 30s | |
scrape_timeout: 10s | |
evaluation_interval: 30s | |
external_labels: | |
prometheus: monitoring/kube-prometheus | |
prometheus_replica: prometheus-kube-prometheus-0 | |
alerting: | |
alert_relabel_configs: | |
- separator: ; |
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
global: | |
scrape_interval: 30s | |
scrape_timeout: 10s | |
evaluation_interval: 30s | |
external_labels: | |
prometheus: monitoring/kube-prometheus | |
prometheus_replica: prometheus-kube-prometheus-0 | |
alerting: | |
alert_relabel_configs: | |
- separator: ; |
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
var collection = Enumerable.Repeat<Comparison>(new Comparison(), 5).ToList(); | |
var items = Enumerable.Range(0, collection.Count).Zip(collection, (a, b) => new { Index = a, Value = b }); | |
foreach(var item in items) | |
{ | |
DoSomething(item.Value, item.Index); | |
} | |
for(var i = 0; i < collection.Count; i++) |
NewerOlder