This file contains 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
@extends('layouts.app') | |
@section('content') | |
<div id="app" class="container"> | |
<div class="row justify-content-center"> | |
<div class="col-md-8"> | |
@if(Session::has('message')) | |
<div class="alert alert-success"> | |
{{session('message')}} |
This file contains 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
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use \App\User; | |
class UserController extends Controller | |
{ | |
protected $serverKey; |
This file contains 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
import os | |
import move | |
from datetime import datetime | |
DIR = '/home/arif/Downloads/' | |
# all files in download folder | |
files_in_download_folders = os.listdir(DIR) |
This file contains 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
import os | |
import shutil | |
import filetypecheck | |
SUB_DIR_LIST = { | |
'DIR_PICS': '/home/arif/Downloads/Pics', | |
'DIR_VIDS': '/home/arif/Downloads/Vids', | |
'DIR_MP3s': '/home/arif/Downloads/MP3s', | |
'DIR_EXCELS': '/home/arif/Downloads/Excels', |
This file contains 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
def isImage(single_file): | |
if single_file.lower().endswith(('.jpg', '.gif', 'jepg', '.png')): | |
return True | |
return False | |
def isMovie(single_file): | |
if single_file.lower().endswith(('.flv', '.avi', 'mov', '.wmv', '.mp4', '.mkv')): | |
return True | |
return False |
This file contains 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
def get_actions(self, request): | |
actions = dict(super().get_actions(request)) | |
customActionsCategory = dict(create_action(cat.name) for cat in Category.objects.all()) | |
customActionsStatus = {'make_status_false': (make_status_false, 'make_status_false', 'Make status false of selected News'), | |
'make_status_true': (make_status_true, 'make_status_true', 'Make status true of selected News') | |
} | |
actions.update(customActionsStatus) | |
actions.update(customActionsCategory) | |
return actions |
This file contains 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
def getCategory(self, obj): | |
return "\n".join([cat.name for cat in obj.category.all()]) |
This file contains 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 django.utils.crypto import get_random_string | |
import environ | |
from django.template.loader import render_to_string | |
from django.core.mail import send_mail | |
from django.core.mail import EmailMultiAlternatives | |
from django.utils.html import strip_tags | |
env = environ.Env() | |
environ.Env.read_env() | |
FRONTEND_URL = env('FRONTEND_URL') |
This file contains 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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title>Verify Email</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style type="text/css"> | |
/** |
This file contains 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
async componentDidMount(){ | |
const token = this.props.match.params.token | |
if (token){ | |
this.setState({token: this.props.match.params.token}) | |
fetch(BASE_API_URL + 'users/validate-email-token', { | |
method: 'post', | |
headers: { | |
'Accept': 'application/json', |