Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active September 14, 2024 16:50
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@ashutoshsmaurya
ashutoshsmaurya / Basckup_Web_Database_Server.sh
Last active December 21, 2020 04:34
Backup Web Server and Database to Google Drive - Bash Script
#!/bin/bash
#Please note - This script tested on Centos-6,7/Redhat-6,7.
#Check Internet Connection
IS=`/bin/ping -c 5 4.2.2.2 | grep -c "64 bytes"`
if (test "$IS" -gt "2") then
internet_conn="1"
#Check Gdrive Software Install Or Not
file="/usr/bin/gdrive"
if [ -f "$file" ]
then
@rushilgupta
rushilgupta / GoConcurrency.md
Last active July 11, 2024 12:52
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@montanaflynn
montanaflynn / pget.go
Last active October 21, 2023 06:12
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index