Skip to content

Instantly share code, notes, and snippets.

Mahendran Kathirvel astromahi

  • Chennai, India
Block or report user

Report or block astromahi

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
caraboides /
Last active Aug 8, 2019
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
set -e
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
/usr/bin/aws s3 mb $S3PATH
uorat / nginx-websocket-proxy.conf
Last active Aug 13, 2019
Nginx Reverse Proxy for WebSocket
View nginx-websocket-proxy.conf
upstream websocket {
server localhost:3000;
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;
Stoffo / remove_documents_mongodb.js
Created Oct 29, 2015
Remove Documents older than x days in MongoDB
View remove_documents_mongodb.js
var date = new Date();
var daysToDeletion = 120;
var deletionDate = new Date(date.setDate(date.getDate() - daysToDeletion));
var db = db.getSiblingDB('db')
printjson(db.messages.find({insertDate : {$lt : deletionDate}}).count());


Let's imagine a very simple table

  id bigserial,
  name character varying
View server.go
package main
import (
bryfry / gzip.go
Last active Aug 5, 2019
Idiomatic golang net/http gzip transparent compression (works with Alice)
View gzip.go
package main
import (
// Gzip Compression
TSiege / The Technical Interview Cheat
Last active Aug 24, 2019
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
View ssl_smtp_example.go
package main
import (
mschoebel / main.go
Created Mar 6, 2014
Snippet: login/logout (Golang)
View main.go
package main
import (
// cookie handling
leesmith /
Last active Aug 14, 2019
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow


You can’t perform that action at this time.