Skip to content

Instantly share code, notes, and snippets.

Avatar
🕒
👈 This is running out!

Tahsin Hassan Rahit rahit

🕒
👈 This is running out!
View GitHub Profile
@rahit
rahit / arma_prediction.py
Created Sep 2, 2016
Time Series Prediction Using ARMA and Linear Regression
View arma_prediction.py
__author__ = "K.M. Tahsin Hassan Rahit"
__email__ = "tahsin.rahit@gmail.com"
import pandas as pd
import statsmodels.api as sm
import matplotlib.pylab as plt
from matplotlib import *
from spectrum import *
from pylab import *
import spectrum.arma
@rahit
rahit / erode_dilate.py
Last active Aug 4, 2016
Theoretical implementation of Erosion and Dilation using OpenCV
View erode_dilate.py
__author__ = "K.M. Tahsin Hassan Rahit"
__email__ = "tahsin.rahit@gmail.com"
import cv2
import numpy as np
def dilate(img, struct_element, origin):
h, w = img.shape
result = img[:,:]
add_y = struct_element.shape[0] - origin[0]
@rahit
rahit / edges.py
Last active May 14, 2022
Canny, Prewitt and Sobel Edge detection using opencv
View edges.py
"""
edges.py: Canny, Prewitt and Sobel Edge detection using opencv
"""
__author__ = "K.M. Tahsin Hassan Rahit"
__email__ = "tahsin.rahit@gmail.com"
import cv2
import numpy as np
img = cv2.imread('messi5.jpg')
@rahit
rahit / form.py
Last active Dec 16, 2015
Dynamic form field based on another model's entries and save them in a m2m way in Django
View form.py
from myapp.models import Attribute, Item, ItemAttribute
from django.forms import ModelForm, HiddenInput, IntegerField, CharField
class ItemForm(ModelForm):
class Meta():
model = Item
exclude = ['attributes']
@rahit
rahit / nginx.conf
Created Dec 9, 2015
resize and crop images using nginx image_filter module with cache support
View nginx.conf
# My project directory is /home/rahit/www/mysite. I am storing cache file in my project folder under cache folder.
# You can use any of your prefered location in system. may be: /tmp/nginx
# I am naming keys_zone name my_cache. You can give it yours. We will need it later on in proxy_cache.
# Just make sure you put same zone name there
proxy_cache_path /home/rahit/www/mysite/cache levels=1:2 keys_zone=my_cache:10m max_size=1G;
# This is our media server, which will be used to resize and crop.
@rahit
rahit / loggify.py
Last active Aug 29, 2015
Script to analyze log file and monitor changes
View loggify.py
'''
Script to analyze log file and monitor changes
@Author: K.M. Tahsin Hassan Rahit <tahsin.rahit@gmail.com> (12-21206-1)
'''
from Tkinter import *
from bsddb.dbtables import _columns_key
from difflib import Differ
from glob import glob