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
{ | |
"variables": { | |
"client_id": "{{env `TF_VAR_clientid`}}", | |
"client_secret": "{{env `TF_VAR_clientsecret`}}", | |
"tenant_id": "{{env `TF_VAR_tenant_id`}}", | |
"subscription_id": "{{env `TF_VAR_subscription_id`}}" | |
}, | |
"builders": [{ | |
"type": "azure-arm", |
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
export TF_VAR_subscription_id="00000000-0000-0000-0000-000000000000" | |
export TF_VAR_tenant_id="11111111-1111-1111-1111-111111111111" |
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
provider "azurerm" { | |
version = "=1.27.0" | |
subscription_id = "00000000-0000-0000-0000-000000000000" | |
tenant_id = "11111111-1111-1111-1111-111111111111" | |
} | |
resource "azurerm_resource_group" "adrons_resource_group_workspace" { | |
name = "adrons_workspace" |
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
# Update the latest packages and make sure certs, curl, https transport, and related packages are updated. | |
sudo apt-get update | |
sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg | |
# Download and install the Microsoft signing key. | |
curl -sL https://packages.microsoft.com/keys/microsoft.asc | \ | |
gpg --dearmor | \ | |
sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null | |
# Add the software repository of the Azure CLI. |
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
func main() { | |
htmlContent, err := ioutil.ReadFile("compositecode.html") | |
if err != nil { | |
fmt.Println(err) | |
} | |
htmlData := string(htmlContent) | |
r := strings.NewReader(htmlData) |
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
func CountWordsAndImages(url string) (words, images int, err error) { | |
resp, err := http.Get(url) | |
if err != nil { | |
return | |
} | |
doc, err := html.Parse(resp.Body) | |
resp.Body.Close() | |
if err != nil { |
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
func visit(links []string, n *html.Node) []string { | |
if n.Type == html.ElementNode && n.Data == "a" { | |
for _, a := range n.Attr { | |
if a.Key == "href" { | |
links = append(links, a.Val) | |
} | |
} | |
} | |
for c := n.FirstChild; c != nil; c = c.NextSibling { | |
links = visit(links, c) |
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
type NodeType int32 | |
const ( | |
ErrorNode NodeType = iota | |
TextNode | |
DocumentNode | |
ElementNode | |
Commentnode | |
DoctypeNode | |
) |
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 main | |
import "fmt" | |
func main() { | |
var this, result int | |
var that, message string | |
this = 2 | |
that = "42" |
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 main | |
import "fmt" | |
func main() { | |
ages := map[string]int{ | |
"Peterson": 52, | |
"Sally": 22, | |
"Javovia": 15, | |
"Ben": 42, |