Skip to content

Instantly share code, notes, and snippets.

View alamin-mahamud's full-sized avatar
🎯
Focusing

Alamin Mahamud alamin-mahamud

🎯
Focusing
View GitHub Profile
@alamin-mahamud
alamin-mahamud / csv_python_functions.py
Created July 11, 2018 06:09
Read, Write functions for CSV in python
import csv
with open("data.csv", "w+") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["Col 1", "Col 2"])
writer.writerow(["Data 1", "Data 2"])
@alamin-mahamud
alamin-mahamud / import_all_py.py
Created July 11, 2018 05:54
List all python (.py) files in the current folder and put them as __all__ variable in __init__.py
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
@alamin-mahamud
alamin-mahamud / mysql-connector-python.py
Created July 11, 2018 04:25
Default Mysql to Python Connector Script
#!/usr/bin/python3
import mysql.connector
from mysql.connector import errorcode
from datetime import date, datetime, timedelta
config = {
'user': 'root',
'password': 'root_mysql',
'host': '127.0.0.1',
'database': 'shoparu_01',
#!/bin/bash
################################################################################
# CORE FUNCTIONS - Do not edit
################################################################################
#
# VARIABLES
#
_bold=$(tput bold)
_underline=$(tput sgr 0 1)
_reset=$(tput sgr0)
{ "workbench.colorTheme": "Monokai", "editor.fontSize": 16, "editor.fontFamily": "'MonacoB', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'" }
@alamin-mahamud
alamin-mahamud / install_docker.sh
Created May 1, 2018 11:07
install docker in ubuntu
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
# Distro: Ubuntu Desktop 16.04 LTS
sudo apt-get install libgtk-3-dev libgtk-3-common libgtk-3-0 -y
sudo apt-get install libtiff5-dev libpng12-dev libjpeg-dev libgif-dev libgnutls-dev libxml2-dev libxpm-dev libncurses-dev -y
# Download the latest version in tar.gz
cd ~/Downloads
tar -xvzf emacs*.tar.gz
rm emacs*.tar.gz
mv emacs* emacs-source
cd emacs-source
./autogen.sh
@alamin-mahamud
alamin-mahamud / code.php
Last active April 7, 2018 08:42
How static() working ?
<?php
class SomeClass {
public static function getInstance()
{
if (null === static::$instance) {
static::$instance = new static();
}
return static::$instance;
Django==1.11.7
flake8==3.5.0
jedi==0.11.0
mccabe==0.6.1
parso==0.1.0
pycodestyle==2.3.1
pyflakes==1.6.0
pypugjs==4.2.2
pytz==2017.3
six==1.11.0