Skip to content

Instantly share code, notes, and snippets.

View Bhargavasomu's full-sized avatar
🏠
Working from home

Somu Bhargava Bhargavasomu

🏠
Working from home
View GitHub Profile
@Bhargavasomu
Bhargavasomu / sendmail.py
Created July 27, 2022 03:09 — forked from jdowner/sendmail.py
How to send email using python
#!/usr/bin/env python
import email.mime.text
import smtplib
username = '[email protected]'
password = '****************'
hostname = 'outlook.office365.com'
msg = email.mime.text.MIMEText('test')
@Bhargavasomu
Bhargavasomu / create_singleton.cpp
Created July 18, 2022 12:41 — forked from abelardojarab/create_singleton.cpp
Create singleton class in C++
// Example program
#include <iostream>
#include <string>
#include <memory>
class singleton
{
static std::shared_ptr<singleton> instance(int a)
{
if (!instance_)
from eth.constants import (
GENESIS_BLOCK_NUMBER,
GENESIS_DIFFICULTY,
GENESIS_GAS_LIMIT,
)
from eth.db.atomic import (
AtomicDB,
)
from eth.db.chain import (
@Bhargavasomu
Bhargavasomu / dict_namedtuple.py
Created January 5, 2019 14:18 — forked from href/dict_namedtuple.py
Convert any dictionary to a named tuple
from collections import namedtuple
def convert(dictionary):
return namedtuple('GenericDict', dictionary.keys())(**dictionary)
"""
>>> d = dictionary(a=1, b='b', c=[3])
>>> named = convert(d)
>>> named.a == d.a
True
>>> named.b == d.b
@Bhargavasomu
Bhargavasomu / git-feature-workflow.md
Created December 26, 2018 04:55 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.