Skip to content

Instantly share code, notes, and snippets.

View rahulvramesh's full-sized avatar
💻
🚊

Rahul V Ramesh rahulvramesh

💻
🚊
View GitHub Profile
@rahulvramesh
rahulvramesh / delete_git_submodule.md
Created June 23, 2020 17:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rahulvramesh
rahulvramesh / etc-init.d-hello-world
Created June 23, 2020 03:42 — forked from josephspurrier/etc-init.d-hello-world
/etc/init.d Script for Go Application
#!/bin/bash
#
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions
@rahulvramesh
rahulvramesh / free_email_provider_domains.txt
Created June 19, 2020 10:51 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@rahulvramesh
rahulvramesh / clean_code.md
Created May 25, 2020 05:26 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@rahulvramesh
rahulvramesh / gmail_imap_example.py
Created April 24, 2020 02:43 — forked from robulouski/gmail_imap_example.py
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@rahulvramesh
rahulvramesh / mac-apps.md
Created April 3, 2020 11:23 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

version: '3.3'
services:
elasticsearch:
ports:
- '9200:9200'
- '9300:9300'
environment:
- discovery.type=single-node
image: 'docker.elastic.co/elasticsearch/elasticsearch:6.8.7'
volumes:
@rahulvramesh
rahulvramesh / connection.js
Last active February 28, 2020 17:48
Twilio Chat
fetch('https://atrom.accubits.com/chat/token', {
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' },
method: 'POST',
body: JSON.stringify({"identity":"rahulvamesh"})
})
.then(res => res.json())
.then(data => Chat.create(data.token))
.then(this.setupChatClient)
.catch(this.handleError);
import requests
import os
import http.client as http_client
import logging
http_client.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.setLevel(logging.DEBUG)
@rahulvramesh
rahulvramesh / s3_multipart_upload.py
Created February 27, 2020 08:30 — forked from teasherm/s3_multipart_upload.py
boto3 S3 Multipart Upload
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)