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
locals { | |
access_token_request_parameters = { | |
scope = "https://management.azure.com/.default" | |
grant_type = "client_credentials" | |
client_id = data.azurerm_client_config.main.client_id | |
client_assertion_type = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" | |
client_assertion = data.local_file.jwt.content | |
} | |
} |
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
resource "azurerm_key_vault_key" "storage" { | |
name = var.name | |
key_vault_id = var.key_vault_id | |
key_type = "RSA" | |
key_size = 4096 | |
key_opts = [ | |
"unwrapKey", | |
"wrapKey" | |
] |
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
data "azurerm_role_definition" "acr_pull" { | |
name = "AcrPull" | |
} | |
resource "azurerm_role_assignment" "role_based_access_control_administrator" { | |
role_definition_name = "Role Based Access Control Administrator" | |
principal_id = azuread_service_principal.main.object_id | |
scope = var.container_registry_id | |
condition_version = "2.0" | |
condition = <<-EOT |
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
package spacelift | |
sample := true | |
module_version := version { | |
version := trim_prefix(input.push.tag, "v") | |
not propose | |
} | |
propose { |
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
name: Deploy | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
workflow_dispatch: | |
env: |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: |
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
using Common; | |
using CountryPull; | |
using Dapr.Client; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
await Host.CreateDefaultBuilder(args).ConfigureServices((context, services) => | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Exchange.WebServices.Data; | |
using static Microsoft.Exchange.WebServices.Data.SearchFilter; | |
namespace Inboxer | |
{ | |
class MainClass | |
{ |
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
if let library = try? ITLibrary(apiVersion: "1") { | |
print(library.applicationVersion) | |
for artist in library.allMediaItems | |
.filter({ $0.mediaKind == ITLibMediaItemMediaKind.kindSong }) | |
.group(by: { $0.artist?.name }){ | |
print(artist.key) | |
for album in artist.value.group(by: { $0.album.title }) { | |
print(" \(album.key) (\(album.value.first!.year))") | |
} | |
} |
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
public extension Sequence { | |
func group<U: Hashable>(by key: (Iterator.Element) -> U?) -> [U:[Iterator.Element]] { | |
var categories: [U: [Iterator.Element]] = [:] | |
for element in self { | |
let key = key(element) | |
if case nil = categories[key!]?.append(element) { | |
categories[key!] = [element] | |
} | |
} | |
return categories |
NewerOlder