from django.conf import settings
from django.db import models
from django.utils import timezone
class InvoiceQuerySet(models.QuerySet):
<?php
declare(strict_types=1);
namespace App\Security;
package auth
import "golang.org/x/crypto/bcrypt"
func HashPassword(pw string, cost int) ([]byte, error) {
if cost == 0 {
class AttachmentContentTypeValidator < ActiveModel::EachValidator
SIGNATURES = {
"image/png" => ["\x89PNG\r\n\x1a\n".b],
"image/jpeg" => ["\xFF\xD8\xFF".b],
"image/gif" => ["GIF87a".b, "GIF89a".b],
"application/pdf" => ["%PDF-".b]
package upload
import (
"errors"
"io"
"log"
<?php
namespace App\Models;
use App\Support\TransientUrl;
use Illuminate\Database\Eloquent\Model;
import hmac
import hashlib
import time
from fastapi import Request, HTTPException, status
import logging
import re
_BASE_FIELDS = set(logging.makeLogRecord({}).__dict__.keys())
_PATTERNS = [
module Api
module V1
class PostsController < BaseController
before_action :authenticate_user!
def create
CREATE TABLE password_reset_tokens (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,
used_at TIMESTAMPTZ,
import { randomBytes } from 'crypto';
import { Request, Response, NextFunction } from 'express';
interface CspOptions {
reportOnly?: boolean;
reportUri?: string;
<?php
namespace App\Tenancy;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;