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" | |
"iter" | |
) | |
type Employee struct { | |
Name string | |
Salary int |
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 ( | |
"database/sql" | |
"fmt" | |
"log" | |
_ "github.com/lib/pq" // Importando driver PostgreSQL | |
) |
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() { | |
var jogo = map[string]int{"Lais": 10, "Asael": 20} | |
fmt.Println(jogo) | |
// Atualiza item | |
jogo["Lais"] = 50 |
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 Node struct { | |
name string | |
next *Node | |
} |
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 main() { | |
var array [3]string | |
array[0] = "Lais" | |
array[1] = "Juliana" | |
array[2] = "Ricardo" | |
//Essa operação não é possível pois o tamanho do array é 3 | |
// array[3] = "Joao" | |
fmt.Printf("%v+\n", array) |
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
# Cut/Trim video | |
ffmpeg -ss 5 -i input.mp4 -to 10 output.mp4 | |
# Video to gif | |
ffmpeg -ss 61.0 -t 2.5 -i <input> -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" output.gif | |
# thumbnail | |
ffmpeg -i mov_bbb.mp4 -ss 00:00:03 -r 1 -s 1280x720 -f image2 thumb_mov.jpeg | |
#text in video |
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 main() { | |
fileUpdated := make(chan string) | |
go WatchEvents(fileUpdated) | |
var filename string | |
go func() { | |
for range fileUpdated { | |
filename = <-fileUpdated |
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/fs" | |
"log" | |
"os" | |
"path/filepath" | |
"github.com/fsnotify/fsnotify" | |
) |
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 go directories and remove | |
$ which go | |
/usr/local/go/bin/go | |
## Install using brew | |
brew install go |
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 main() { | |
n := func() int { | |
return 2 | |
} | |
x := sumNumber(n()) | |
fmt.Println(x) | |
} | |
func sumNumber(number int) int { |
NewerOlder