I know you came for solution as always i don’t talk much ;)
cmd/go: go mod init fails to determine module path in subdirectory
#1
: Update your go path to your current working directory (you can specify multiple using :
)
export GOPATH=”/Users/XXXX/dir1:/Users/XXXX/dir2"
#2
: if Plan A
not working then Plan B
go mod init <module_name>
Hopefully Plan B
works, if not please mention in comment section. i can help you :)
For any New YouTuber, the biggest hurdle is video editing. In this video, I am going to show you how to edit your videos like a PRO using iMovie
This is a step by step based tutorial, you can directly skip to the respective topic if you don’t want to watch the entire video. Please find the timestamps below:
2:12 Import Media
2:36 Add Videos to Timeline
3:14 Adding Voiceover
5:15 Adding Tiles
6:30 Adding Transitions
7:26 Adding Timelapse Effect
9:48 Adding an image (logo)
13:50 Green Screen Effects
17:29 Animation using Keynote
18:53 Animated Intro
21:00 Remove BG Noise
21:47 Export to Media
Originally published at https://dev.to on June 25, 2020.
I use OpenStreetMaps/Datahub.io to get the polygon data for an area.
For Country Geo-JSON data I prefer Datahub.io and for others Open street maps.
Links:
https://nominatim.openstreetmap.org/search.php?q=liege&polygon_geojson=1&format=json
While validating a Geo-JSON data using https://geojsonlint.com/ or any other site, sometimes you may see the below error saying
Line 1: Polygons and MultiPolygons should follow the right-hand rule
Sometimes intentionally or unintentionally you may have given a wrong commit message due to various reasons.
But don’t worry…
You can change your commit messages with GIT rebase
command.
checkout your branch where you want to change your commit messages
git checkout <branch>
Rebase will help you modify your commit messages, squash and merge all your commits into one, but this tutorial is mainly to edit your messages. I will talk more about rebase
in another tutorial.
git rebase -i HEAD~N
display a list of the last
Ncommits in your default text editor.
Sometimes you may have to delete or truncate your records in the table for your local or dev testing. An easy way is to do with the below command.
delete from <table> where <condition> = <value>
This Works!!!
But the above command doesn’t restart the sequences i.e; IDENTITY
and CASCADE
associated with table columns.
One Option is:
TRUNCATE <table_name> RESTART IDENTITY CASCADE;
Credits:
[Stack Overflow](https://stackoverflow.com/questions/5342440/reset-auto-increment-counter-in-postgres)
Recently I had faced an issue while using net/http
to get the resource from an URL:
Here is my program:
package main import ( "fmt" "log" "net/http" ) type WebScrapper interface { PullContent(url string) } type webScrapper struct { } func (w *webScrapper) PullContent(url string) { resp, err := http.Get(url) if err != nil { panic(err) } defer (func() { if r := recover(); r != nil { fmt.Printf("Recovered from panic %s", r) } })() log.Printf("Got response for %s and status is %s", url, resp.Status) } func main() { w := webScrapper{} urls := []string{ "www.google.com", "www.facebook.com", "www.gmail.com", } for…
Mux is a powerful HTTP router that matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions.
Enough talking ….
Please create a new file called main.go
and paste the below contents
package main import ( "fmt" "github.com/gorilla/mux" "io" "log" "net/http" "os" ) func UploadFile(w http.ResponseWriter, r *http.Request) { file, handler, err := r.FormFile("file") fileName := r.FormValue("file_name") if err != nil { panic(err) } defer file.Close() f, err := os.OpenFile(handler.Filename, os.O_WRONLY|os.O_CREATE, 0666) if err != nil { panic(err) } defer f.Close() _, _ = io.WriteString(w, "File "+fileName+"…
Recently I got a chance to taste the fish
and I must say it's awesome even though I am totally into bash till now. This Fish Shell is a fully-equipped command line shell that is smart and user-friendly.
There are multiple reasons to say that it is the best tool and some of them are:
Let's talk about it more!!!
You can find a hell number of articles about this, but I wanted to stress more on customizing your existing Fish shell.
One of my biggest questions when I initially started using…
A typical software engineer who travels daily 4 hours to office in bangalore traffic :) #hangoutdude hangoutdude.com