Skip to content

Instantly share code, notes, and snippets.

View zahidhasanemon's full-sized avatar

zahid hasan emon zahidhasanemon

View GitHub Profile
@zahidhasanemon
zahidhasanemon / Controller.php
Last active September 23, 2024 00:20
Multiple file upload asynchronously using Laravel and Dropzone JS. Works perfectly with multiple files dragged and dropped or selected at a time. Images are uploaded via ajax request.
//add image to the storage disk.
public function uploadImageViaAjax(Request $request)
{
$name = [];
$original_name = [];
foreach ($request->file('file') as $key => $value) {
$image = uniqid() . time() . '.' . $value->getClientOriginalExtension();
$destinationPath = public_path().'/images/';
$value->move($destinationPath, $image);
$name[] = $image;
a = [1,10,5,6,7,3,2,8,88,20]
b=[]
user = int(raw_input("enter a number to compare: "))
for num in a:
if num >= user:
b.append(num)
print b
number = int(raw_input("enter a number: "))
if number % 2 == 0:
if number % 4 ==0:
print "%s is an even number and multiple of 4" %number
else:
print "%s is an even number" %number
else:
print "%s is an odd number" %number
from datetime import datetime
now = datetime.now()
name = raw_input("enter your name: ")
age = raw_input("enter your age: ")
nprint = int(raw_input("enter the number of times to print the message: "))
year = now.year
century = ((100-int(age))+ year)
message = "%s you are now %s and you will be hundread years old in %s "\
%(name,age,century)
print nprint*message