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
/* | |
Title: | |
Break camelCase | |
Description: | |
Write simple .camelCase method (camel_case function in PHP or CamelCase in C#) for strings. All words must have their first letter capitalized without spaces. | |
Examples: | |
"hello case".camelCase() => HelloCase | |
"camel case word".camelCase() => CamelCaseWord | |
Kata Link: | |
https://www.codewars.com/kata/break-camelcase |
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
Description: | |
Given the triangle of consecutive odd numbers: | |
1 | |
3 5 | |
7 9 11 | |
13 15 17 19 | |
21 23 25 27 29 | |
... |
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" | |
func main() { | |
a := []byte{'A', 'M', 'N', 'J', 'E', 'E', 'T'} | |
b := s(a) | |
b[0], b[1] = b[1], b[0] | |
fmt.Println(string(a)) |
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" | |
"sync" | |
"time" | |
) | |
func main() { | |
var mu sync.Mutex |
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
// Slice rules in go programming language | |
starting cap growth factor | |
256 2.0 | |
512 1.63 | |
1024 1.44 | |
2048 1.35 | |
4096 1.30 | |
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
1. Query to your local database to check that cloudtrail data is present in the local database. | |
IF yes | |
// It means you have stored some data from cloudtrail before. | |
// And now you are going to do request to cloudtrail for new trail events. | |
// Note - At a time of the first request you don't have a token (i.e. next-token) | |
GOTO Step 3 | |
ELSE |
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" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"strings" |
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 ( | |
"bytes" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
) |
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
func addConcurrent(numbers []int) int { | |
var v int64 | |
goroutines := runtime.NumCPU() | |
totalNumbers := len(numbers) | |
lastGoroutine := goroutines - 1 | |
stride := totalNumbers / goroutines | |
var wg sync.WaitGroup | |
wg.Add(goroutines) |
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
linters-settings: | |
govet: | |
check-shadowing: true | |
settings: | |
printf: | |
funcs: | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
NewerOlder