Skip to content

Instantly share code, notes, and snippets.

View SamsadSajid's full-sized avatar

SamsadSajid

View GitHub Profile
## laravel_project.conf
NameVirtualHost *:8080
Listen 8080
<VirtualHost *:8080>
ServerAdmin [email protected]
ServerName laravel.dev
ServerAlias www.laravel.dev
DocumentRoot /home/user/projects/laravel_project/public
@SamsadSajid
SamsadSajid / ContractDefinition.sol
Last active May 16, 2018 13:40
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.17;
contract Inbox {
string public message;
function Inbox(string initialMessage) public {
message = initialMessage;
}
%------------------------------------------------------------
% Edited by Sajid Samsad
% 1405118, Dept of CSE, BUET
%------------------------------------------------------------
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{utopia} %font utopia imported
\usepackage{physics}
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>FunderPrenuer</title>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="font-awesome.min.css"> -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
def add_product(request):
user = request.user
product_list = ProductList()
if request.method == 'POST':
print ('yoo')
form = ProductForm(request.POST, request.FILES)
print ('yoo')
print (form)
if form.is_valid():
print ('yoo')
class ProductForm(forms.ModelForm):
product_id = forms.IntegerField(
widget=forms.TextInput(attrs={'class': 'form-control'}),
required=True
)
product_name = forms.CharField(
widget=forms.TextInput(attrs={'class': 'form-control'}),
max_length=100,
required=True)
product_image = forms.FileField(
{% extends 'dashboard/test.html' %}
{% load staticfiles %}
{% load i18n %}
{% block content %}
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
==========================
Creating target directory...
==========================
Command start time 2017-12-13 17:02:25
Connection to ajoy.net closed.
SSH command execution finished
host=ajoy.net, exitcode=0
Command end time 2017-12-13 17:02:30
@SamsadSajid
SamsadSajid / picture.py
Last active November 26, 2017 12:22
Picture will be reshaped using PIL from PILLOW
@login_required(login_url='/login/')
@group_required('client_group')
def picture(request):
user = request.user
profile_pictures = django_settings.MEDIA_ROOT + '/profile_pictures/'
if not os.path.exists(profile_pictures):
os.makedirs(profile_pictures)
if request.method == 'POST':
_picture = request.FILES['picture']
filename = profile_pictures + request.user.username + '_' + str(request.user.id) + '.jpg'