Skip to content

Instantly share code, notes, and snippets.

View ijharulislam's full-sized avatar

ijhar ijharulislam

  • Full-stack Web Developer
  • Dhaka, Bangladesh.
View GitHub Profile
@login_required
def income_statement_pdf(request):
from weasyprint import HTML
items = Transactions.objects.filter(institute_id=request.session['institute_id'])
from_date = request.GET.get("from_date", "").strip()
to_date = request.GET.get("to_date", "").strip()
account_id = request.GET.get("account")
তথাকথিত সালাফী আলেমদের আকিদাগত মতবিরোধ (পর্ব-১)◄█▓▒░
ইসলামের মূল হলো বিশ্বাস। আল্লাহ সম্পর্কে বিশ্বাস।
আল্রাহর নবী-রাসূল, ফেরেশতা ও পরকাল সম্পর্কে বিশ্বাস।
█►https://facebook.com/notes/324360791046673
তথাকথিত সালাফী আলেমদের আকিদাগত মতবিরোধ (পর্ব-২)◄█▓▒░
আল্লাহ তায়ালা আরশে বসে আছেন (নাউযুবিল্লাহ)
আরশে বসার ব্যাপারে ইহুদী আকিদা:
█►https://facebook.com/notes/324487681033984
@ijharulislam
ijharulislam / html_input_dict.py
Created August 10, 2018 11:53 — forked from MasterAlish/html_input_dict.py
Django html input array and dict
def get_html_input_dict(self, query_dict, param):
dictionary = {}
regex = re.compile('%s\[([\w\d_]+)\]' % param)
for key, value in query_dict.items():
match = regex.match(key)
if match:
inner_key = match.group(1)
dictionary[inner_key] = value
return dictionary
# Docomo
input_data={
"format": [
{"regex_item": "Null", "regex_match": "Null", "remove_tag": "1", "item_name": "name", "xpath": "/html/body/div[2]/div[3]/div[1]/main/article/section[1]/div[1]/h2"},
{"regex_item": "${1} ", "regex_match": "([\\d\\-\\\u2212\\\u2010]+)", "remove_tag": "1", "item_name": "zip", "xpath": "/html/body/div[2]/div[3]/div[1]/main/article/section[1]/div[2]/div[1]/div/div[2]/figure/table/tbody/tr[1]/td/text()[1]"},
{"regex_item": "Null", "regex_match": "Null", "remove_tag": "1", "item_name": "address", "xpath": "/html/body/div[2]/div[3]/div[1]/main/article/section[1]/div[2]/div[1]/div/div[2]/figure/table/tbody/tr[1]/td/text()[2]"},
{"regex_item": "Null", "regex_match": "Null", "remove_tag": "1", "item_name": "tel", "xpath": "/html/body/div[2]/div[3]/div[1]/main/article/section[1]/div[2]/div[1]/div/div[2]/figure/table/tbody/tr[1]/td/span[1]"}],
"coordination": [
{
"srid": "",
var data = $.csv.toObjects(data);
console.log(data)
var i = 0;
function ScrapeLocation(){
if (data[i].Location){
var q = data[i].Params + "+" + data[i].Location;
} else {
var q = data[i].Params + "+" + data[0].Location;
}
def parse_dir_contents(self, response):
tr = response.xpath('//*[@id="medicine-box"]/table//tr')
item = CzechItem()
for t in tr:
th = t.xpath('th/text()').extract_first()
if th == 'SÚKL code':
item['sukl_code'] = t.xpath('td/text()').extract_first()
elif th == 'Name of the product':
item['product_name'] = t.xpath('td/text()').extract_first()
elif th == '_MA_MEDICATION_DETAIL_INFO_MED_NAME':
from account.models import Store, UserAccount
from django.utils.deprecation import MiddlewareMixin
class StoreSessionMiddleware(MiddlewareMixin):
def process_request(self, request):
if "store_id" in request.POST:
print "setting session store id"
import urllib.parse
import urllib.request
import json
input_data = {
'format':
[
{
'item_name': 'name',
for (;;);{"__ar":1,"__sf":"h0","payload":"\u003Cul class=\"uiList _262m expandedList _4kg\" data-pnref=\"friends\">\u003Cli class=\"_698\">\u003Cdiv class=\"clearfix _5qo4\" data-pnref=\"all\" data-testid=\"friend_list_item\">\u003Ca class=\"_5q6s _8o _8t lfloat _ohe\" href=\"https:\/\/www.facebook.com\/mohiuddin.faroqi?fref=pb&hc_location=friends_tab\" tabindex=\"-1\" aria-hidden=\"true\" data-hovercard=\"\/ajax\/hovercard\/user.php?id=100002368397837&extragetparams=\u00257B\u002522hc_location\u002522\u00253A\u002522friends_tab\u002522\u00257D\" data-hovercard-prefer-more-content-show=\"1\">\u003Cimg class=\"_s0 _4ooo _1ve7 _rv img\" src=\"https:\/\/scontent-sit4-1.xx.fbcdn.net\/v\/t1.0-1\/p100x100\/21752250_1467153253373607_587728767527746559_n.jpg?oh=077db5e67e69833e5874b74b738a84a7&oe=5A864F7E\" alt=\"\" aria-label=\"Mohiuddin Faroqi\" role=\"img\" \/>\u003C\/a>\u003Cdiv class=\"clearfix _42ef\">\u003Cdiv class=\"_6a rfloat _ohf\">\u003Cdiv class=\"_6a _6b\" style=\"height:100px\">\u003C\/div>
# -*- coding: utf-8 -*-
import scrapy
from nafdac.items import NafdacItem
class NafDacCrawlerSpider(scrapy.Spider):
name = 'nafdac'
def start_requests(self):