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 { Link } from "@inertiajs/react"; | |
function buildPageUrls(current, last, links) { | |
const delta = 3; | |
const range = []; | |
const left = Math.max(2, current - delta); | |
const right = Math.min(last - 1, current + delta); | |
let l = 1; // track last added page number, start from 1 because first page added below | |
range.push({ page: 1, url: links.first }); |
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 "tailwindcss"; |
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 requests | |
from bs4 import BeautifulSoup | |
def get_latest_news(): | |
url = "https://www.amnesty.org/en/" | |
headers = {"User-Agent": "Mozilla/5.0"} # Helps to avoid being blocked | |
response = requests.get(url, headers=headers) | |
if response.status_code != 200: | |
print(f"Failed to fetch page. Status code: {response.status_code}") |
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
<x-layout title="home"> | |
<div class="space-y-4"> | |
<h1 class="font-bold text-4xl">login</h1> | |
<form action="{{ route('login') }}" method="POST" class="space-y-4" novalidate> | |
@csrf | |
@session('success') | |
<div class="bg-green-100 border-green-600 border text-green-900 text-center p-2 rounded"> | |
{{ $value }} | |
</div> | |
@endsession |