To create a new subscription in Azure using the Azure Resource Manager (ARM) provider in Terraform, you need to perform the following steps:
Configure the AzureRM provider: In your Terraform configuration file (usually main.tf), add the AzureRM provider block and specify the necessary authentication details. This typically includes the subscription_id, client_id, client_secret, and tenant_id. Here's an example:
hcl
Copy code
provider "azurerm" {
subscription_id = "<subscription_id>"
client_id = "<client_id>"
client_secret = "<client_secret>"
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 dataclasses | |
| import json | |
| def default_dataclass_init_method(self, kwargs): | |
| for fi in dataclasses.fields(self): | |
| value = kwargs.get(fi.name, fi.default) | |
| if value == dataclasses.MISSING: | |
| if fi.default_factory == dataclasses.MISSING: | |
| raise ValueError('missing field ' + fi.name + ' and no default/factory') |
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 collections | |
| class ReadOnlyDict(collections.UserDict): | |
| def __init__(self, data: dict): | |
| super().__init__() | |
| self.data = data | |
| def __setitem__(self, key, item): | |
| raise TypeError |
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 org.example; | |
| import lombok.RequiredArgsConstructor; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.http.MediaType; | |
| import org.springframework.util.MultiValueMap; | |
| import org.springframework.web.reactive.function.server.RouterFunction; |
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
| // cat > src/main/java/org/example/App.java <<'EOF' | |
| package org.example; | |
| import lombok.Data; | |
| import lombok.experimental.Accessors; | |
| import org.springframework.boot.ApplicationRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.boot.context.properties.ConfigurationProperties; | |
| import org.springframework.context.annotation.Bean; |
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 org.gradle.api.internal.tasks.AbstractTaskDependency | |
| import org.gradle.api.plugins.jvm.JvmTestSuite | |
| static String printDeps(Task task) { | |
| StringBuilder buffer = new StringBuilder(50) | |
| printDeps(task, buffer, "", "") | |
| return buffer.toString() | |
| } | |
| @SuppressWarnings('ConfigurationAvoidance') |
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 lombok.*; | |
| import lombok.experimental.Accessors; | |
| import java.nio.ByteBuffer; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| import java.util.Arrays; | |
| import java.util.Map; | |
| import java.util.function.Function; | |
| import java.util.stream.Collectors; |
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
| let levels = { | |
| error: 200, | |
| warn: 300, | |
| info: 400, | |
| debug: 500, | |
| trace: 600, | |
| } | |
| let level = levels['info']; |
to run this benchmark, go to https://jsbench.me and copy the below inputs:
let random = () => (Math.random() + 1).toString(36).substring(7);
let dummyArray = Array(10000).fill(null).map(random)
let dummySet = new Set(Array(10000).fill(null).map(random))