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
caraboides / backup-mongodb-to-s3.sh
Last active May 22, 2019
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
View backup-mongodb-to-s3.sh
#!/bin/sh
set -e
HOST=localhost
DB=test-entd-products
COL=asimproducts
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/"
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
S3LATEST=$S3PATH"latest".dump.gz
/usr/bin/aws s3 mb $S3PATH
@uorat
uorat / nginx-websocket-proxy.conf
Last active May 26, 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
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));
printjson(deletionDate);
var db = db.getSiblingDB('db')
db.getMongo().setSlaveOk();
printjson(db.messages.find({insertDate : {$lt : deletionDate}}).count());
View goi.md

Interfaces

Let's imagine a very simple table

CREATE TABLE people {
  id bigserial,
  name character varying
}
View server.go
package main
import (
"fmt"
"log"
"net/http"
"html/template"
"github.com/gorilla/sessions"
@bryfry
bryfry / gzip.go
Last active Jun 23, 2019
Idiomatic golang net/http gzip transparent compression (works with Alice)
View gzip.go
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
// Gzip Compression
@TSiege
TSiege / The Technical Interview Cheat Sheet.md
Last active Jun 26, 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 Sheet.md

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 (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@mschoebel
mschoebel / main.go
Created Mar 6, 2014
Snippet: login/logout (Golang)
View main.go
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@leesmith
leesmith / simple-git-workflow.md
Last active Apr 9, 2019
Simple Git Workflow For Continuous Delivery
View simple-git-workflow.md

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

Workflow

You can’t perform that action at this time.