Skip to content

Instantly share code, notes, and snippets.

View ramitsurana's full-sized avatar

Ramit Surana ramitsurana

View GitHub Profile
@ramitsurana
ramitsurana / frontend-ws-connection.ts
Created April 23, 2023 16:44 — forked from jsdevtom/frontend-ws-connection.ts
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@ramitsurana
ramitsurana / check.go
Created July 28, 2016 16:40 — forked from mattes/check.go
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); err == nil {
// path/to/whatever exists
}
@ramitsurana
ramitsurana / README.md
Created July 20, 2016 12:18 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@ramitsurana
ramitsurana / install.sh
Created May 20, 2016 06:57 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@ramitsurana
ramitsurana / active.md
Last active August 29, 2015 14:19 — forked from paulmillr/active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Thu, 03 Apr 2014 02:35:55 GMT till Fri, 03 Apr 2015 02:35:55 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -&gt; user.followers &gt; 386)