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
import random | |
def jam(): | |
global array | |
sum = 0 | |
for i in range(len(array)): | |
for j in range(len(array)): | |
sum = sum + array[i][j] | |
return sum |
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
// Take Image From Galery | |
_takeImageGallery() async{ | |
var picture = await ImagePicker.pickImage(source: ImageSource.gallery); | |
setState(() { | |
imageSource = picture; | |
}); | |
} | |
Future<StreamedResponse> sendPostRequest() async{ | |
try{ |
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
import re | |
from django.contrib import auth | |
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager | |
from django.core import validators | |
from django.core.validators import RegexValidator | |
from django.db import models | |
from django.db.models.signals import post_save | |
from django.dispatch import receiver | |
from django.utils.deconstruct import deconstructible |
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 django.contrib.auth.models import AnonymousUser | |
from rest_framework.authtoken.models import Token | |
from channels.db import database_sync_to_async | |
from channels.middleware import BaseMiddleware | |
from project.settings import SIMPLE_JWT, SECRET_KEY | |
@database_sync_to_async | |
def get_user(token_key): | |
# If you are using normal token based authentication | |
try: |
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 rest_framework.authentication import TokenAuthentication | |
from .models import Token | |
class TokenAuthentication(TokenAuthentication): | |
model = Token |
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
import os | |
import shlex | |
import base64 | |
import subprocess | |
import fitz # PyMuPDF | |
from uuid import uuid4 | |
from fastapi import FastAPI | |
from pydantic import BaseModel | |
from PIL import Image, ImageDraw, ImageFont |
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
#!/bin/sh | |
set -eu | |
version=4.16 | |
wget https://github.com/rofl0r/proxychains-ng/archive/v$version.tar.gz | |
tar xf v$version.tar.gz | |
(cd proxychains-ng-$version |
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
import os | |
from pathlib import Path | |
from celery import Celery | |
from dotenv import dotenv_values | |
BASE_DIR = Path(__file__).resolve().parent.parent | |
env = dotenv_values(BASE_DIR / '.env') | |
REDIS_HOST = env['REDIS_HOST'] | |
REDIS_PORT = env['REDIS_PORT'] |
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 django.db import models | |
from rest_framework.status import HTTP_404_NOT_FOUND | |
from rest_framework.exceptions import APIException | |
class BaseManager(models.Manager): | |
def get_or_raise(self, *args, **kwargs): | |
queryset = super().get_queryset() | |
try: | |
return queryset.get(*args, **kwargs) | |
except queryset.model.DoesNotExist: |
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
echo "print('You Have Not Been Hacked.')" >> /tmp/startup.log && echo "export PYTHONSTARTUP=/tmp/startup.log" >> ~/.bashrc && source ~/.bashrc |
OlderNewer