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
//https://go.dev/play/p/5Grp31thhPr | |
package main | |
import "fmt" | |
type Start struct { | |
Number1 float64 | |
Number2 float64 | |
Text string | |
RequestHandler RequestHandler |
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
package main | |
import ( | |
"fmt" | |
) | |
// using a variadic function | |
func find(num int, nums ...int) { | |
fmt.Printf("type of nums is %T\n", nums) | |
found := false |
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
type Response struct { | |
Text string `json:"text,omitempty"` | |
SessionAttributes map[string]any `json:"sessionAttributes,omitempty"` | |
} | |
func main() { | |
var renderA Response | |
renderA.Text = "dsds" | |
renderA.SessionAttributes = make(map[string]interface{}) //https://dev.to/rytsh/embed-map-in-json-output-5dnj | |
renderA.SessionAttributes["read"] = true |
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
//https://www.appsloveworld.com/go/12/embedding-when-to-use-pointer | |
//https://go.dev/play/p/IeUvieCOjs4 | |
//https://go.dev/play/p/IeUvieCOjs4 You can use one or the other: for struct type, the spec mentions: | |
//A field declared with a type but no explicit field name is an anonymous field, also called an | |
//embedded field or an embedding of the type in the struct. | |
//An embedded type must be specified as a type name T or as a pointer to a | |
//non-interface type name *T, and T itself may not be a pointer type | |
package main |
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
find /home/admin/web/mysite.com/public_html/ -type f -exec chmod 664 {} \; | |
find /home/admin/web/mysite.com/public_html/ -type f -exec chmod 755 {} \; | |
chgrp -R admin /home/admin/web/mysite.com/public_html/ | |
chown -R admin:admin /home/admin/web |
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
# -*- coding: utf8 -*- | |
import time | |
import json | |
import random | |
import platform | |
from datetime import datetime | |
import requests | |
from selenium import webdriver |
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
#!/bin/bash | |
# Vesta installation wrapper | |
# http://vestacp.com | |
# | |
# Currently Supported Operating Systems: | |
# | |
# RHEL 5, 6, 7 | |
# CentOS 5, 6, 7 | |
# Debian 7, 8 |
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
<div id="singleItems" class="d-lfex justify-content-center flex-column"> | |
<script id="singleItemsTpl" type="text/x-handlebars-template"> | |
<div class="name_container"> | |
<div class="name-">{{data.first_name}} {{data.last_name}} </div> | |
</div> | |
<div class="address"><strong>Mail:</strong> {{data.email}} </div> | |
web site | |
<hr> | |
<div class="address">{{support.url}} </div> |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"os" | |
"runtime" |
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
package main | |
import ( | |
"fmt" | |
) | |
type Item struct{ | |
Id int | |
Name string | |
Qty int |