Skip to content

Instantly share code, notes, and snippets.

View asadlive84's full-sized avatar

Asaduzzaman Sohel asadlive84

View GitHub Profile
@asadlive84
asadlive84 / gist:0476931fe80b339afa4c
Last active August 29, 2015 14:10
Shortcode with custom Post n Category
//Shortcode with Custom Post
<?php
function accordion_list_shortcode($atts){
extract( shortcode_atts( array(
'category' => '',
'count' => '5',
), $atts, 'wishlist' ) );
$q = new WP_Query(
@asadlive84
asadlive84 / frontendDevlopmentBookmarks.md
Created September 22, 2015 13:55 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@asadlive84
asadlive84 / sublime-settings-osx.json
Created November 5, 2016 16:01 — forked from arvi/sublime-settings-osx.json
Sublime Settings OSX
{
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".",
"selector": "source.js"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-16">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>invoice copy {% if customers.customer_name %}Customer Name:{{customers.customer_name}}{% else %}
context = {'customers': customers,
'sys_type': sys_type,
'area': area,
'site_credit': site_credit,
'site_name': 'Moon Telecom',
'sys_type': sys_type,
'due_taka_track': due_taka_track,
'total_paid_taka': total_paid_taka,
'payment_message': payment_message,
'time_now': time_now,
@asadlive84
asadlive84 / pdf.py
Created November 8, 2017 07:10
bangla font not rendering
import codecs
from weasyprint import HTML, CSS
from django.template import loader,RequestContext
from django.template.loader import render_to_string
from .forms import AdvanceCustomerForm
#include<stdio.h>
int main(){
int a,b,i=0,x,y;
char c;
scanf("%d",&y);
for(x=0;x<y;x++){
i++;
scanf("%d %d %c", &a, &b, &c);
if(c=='+'){
printf("Case %d: %d\n",i,a+b);
class StdCommon(models.Model):
pub_date=models.DateTimeField(auto_now=True)
update_date = models.DateTimeField(auto_now_add=True)
class StdSubject(StdCommon):
subject_name = models.CharField('Subject Name', max_length=100)
subject_full_marks = models.DecimalField(
'Full Marks', max_digits=5, decimal_places=2, default=100)
subject_pass_marks = models.DecimalField(
from django.forms import ModelForm
from django import forms
class ChildInlineFormSet(BaseInlineFormSet):
'''
def __init__(self, *args, **kwargs):
super(ChildInlineFormSet, self).__init__(*args, **kwargs)
# Now we need to make a queryset to each field of each form inline
self.queryset = Marks.objects.filter(subject_name__subjet_class=10).order_by('-subject_name')
print(self.queryset)
'''
class MarksSubjectInstanceInline(admin.TabularInline):
model = Marks
fk_name = 'std_name'
extra = 2
exclude = ['subject_gradepoint', 'subject_gpa','subject_gpa_sub', 'subject_marks', 'subject_total_marks']
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "subject_name":
kwargs["queryset"] = StdSubject.objects.filter(std_subject_class__std_class_name_N__exact=<problem in here I want to math student study class info math>)