Skip to content

Instantly share code, notes, and snippets.

Yogesh Narayanan yogeshnarayanan

Block or report user

Report or block yogeshnarayanan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yogeshnarayanan
yogeshnarayanan / git-repo-mirror.sh
Created Dec 6, 2018
Git Command to move repository origin
View git-repo-mirror.sh
git clone --bare https://github.com/exampleuser/old-repository.git
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
@yogeshnarayanan
yogeshnarayanan / jsconfig.json
Created Sep 14, 2018
VSCode jsconfig.json to support Absolute path navigation in React project
View jsconfig.json
{
"compilerOptions": {
"baseUrl": "./src/",
"target": "es6",
"jsx": "react",
"module": "commonjs"
},
"include": ["src/**/*"]
}
@yogeshnarayanan
yogeshnarayanan / limit-goroutines.go
Created Dec 5, 2017
Limiting number of goroutines (concurrency) in golang
View limit-goroutines.go
concurrency := 10 // 10 is max concurrency
sem := make(chan bool, concurrency)
urls := []string{"url1", "url2"}
for _, url := range urls {
sem <- true // mark one as running (will block when full)
go func(url) {
defer func() { <-sem }() // mark one as completed
// Do something with the url
}(url)
}
You can’t perform that action at this time.