Skip to content

Instantly share code, notes, and snippets.

View rahit's full-sized avatar
🕒
👈 This is running out!

Tahsin Hassan Rahit rahit

🕒
👈 This is running out!
View GitHub Profile
@rahit
rahit / loggify.py
Last active August 29, 2015 13:58
Script to analyze log file and monitor changes
'''
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
@rahit
rahit / form.py
Last active December 16, 2015 16:52
Dynamic form field based on another model's entries and save them in a m2m way in Django
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 / arma_prediction.py
Created September 2, 2016 22:00
Time Series Prediction Using ARMA and Linear Regression
__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 August 5, 2022 08:51
Theoretical implementation of Erosion and Dilation using OpenCV
__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 / nginx.conf
Created December 9, 2015 17:50
resize and crop images using nginx image_filter module with cache support
# 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 / edges.py
Last active December 23, 2023 02:17
Canny, Prewitt and Sobel Edge detection using opencv
"""
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')