This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import ceil | |
class Pagination(object): | |
def __init__(self, page, per_page, total_count): | |
self.page = page | |
self.per_page = per_page | |
self.total_count = total_count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="/css/style.css" /> | |
<style> | |
body { background: #f0f0f0; margin:0; padding:0;} | |
</style> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#process-btn').on('click', function (e) { | |
if ($(this).hasClass('disabled') || ($('.dz-complete').length != $('.dz-processing').length)) { | |
e.preventDefault(); | |
} | |
else { | |
e.preventDefault(); | |
//construct array from filenames | |
var videos = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dropzone.autoDiscover = false; | |
$("#dz-video").dropzone({ | |
acceptedFiles: 'video/mp4,video/quicktime', | |
maxFilesize: 1000, | |
addRemoveLinks: true, | |
success: function (file, response) { | |
$(file['previewElement']).data('filename', response); | |
//console.log('Successfully uploaded: ' + response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bp_public.route('/video-upload',methods=['POST']) | |
@login_required | |
def video_upload(): | |
file = request.files['file'] if 'file' in request.files else None | |
if file: | |
file_name = datetime.strftime(datetime.now(),'%Y%m%d-%H%S') +'-'+ secure_filename(file.filename) | |
file.save(os.path.join(Config.UPLOAD_DIR,file_name)) | |
return file_name, 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37.104.234.112 | |
176.204.166.251 | |
95.185.167.245 | |
176.204.166.187 | |
95.186.126.43 | |
93.169.129.24 | |
78.95.229.134 | |
51.39.164.121 | |
37.241.243.123 | |
188.49.168.89 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from extensions import db | |
from slugify import slugify | |
class Card(db.Document): | |
client_id = db.IntField() | |
card_id = db.SequenceField(unique=True) | |
ref = db.StringField() | |
emirate = db.StringField() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Bucket Fill Exercise | |
Imagine you are working on an image editing application. You need to implement a bucket fill tool similar to the one | |
in paint. The user will use the tool by selecting a color and clicking on the canvas. The tool fills the selected | |
region of color with the new color. | |
When a pixel is filled, all of its neighbors (above, below, left, or right) of the same color must also be filled, | |
as well as their neighbors, and so on, until the entire region has been filled with the new color. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
root 1 0.0 0.2 24320 1048 ? Ss May04 10:53 /sbin/init | |
root 2 0.0 0.0 0 0 ? S May04 0:00 [kthreadd] | |
root 3 0.0 0.0 0 0 ? S May04 111:37 [ksoftirqd/0] | |
root 5 0.0 0.0 0 0 ? S< May04 0:00 [kworker/0:0H] | |
root 6 0.0 0.0 0 0 ? S May04 0:00 [kworker/u:0] | |
root 7 0.0 0.0 0 0 ? S< May04 0:00 [kworker/u:0H] | |
root 8 0.0 0.0 0 0 ? S May04 0:00 [migration/0] | |
root 9 0.0 0.0 0 0 ? S May04 0:00 [rcu_bh] | |
root 10 0.0 0.0 0 0 ? S May04 107:26 [rcu_sched] |