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
| System: | |
| Kernel: 6.17.0-22-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0 | |
| Desktop: KDE Plasma v: 5.27.12 Distro: Kubuntu 24.04.4 LTS (Noble Numbat) | |
| base: Ubuntu | |
| Machine: | |
| Type: Desktop Mobo: BIOSTAR model: H610MH D5 serial: <superuser required> | |
| UEFI: American Megatrends LLC. v: 5.27 date: 09/12/2023 | |
| CPU: | |
| Info: 20-core (8-mt/12-st) model: Intel Core i7-14700F bits: 64 | |
| type: MST AMCP arch: Raptor Lake rev: 1 cache: L1: 1.8 MiB L2: 28 MiB |
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
| const CHUNK_SIZE = 10 * 1024 * 1024; // 10MB | |
| async function uploadFile(file) { | |
| const totalChunks = Math.ceil(file.size / CHUNK_SIZE); | |
| const init = await fetch("/api/upload/init", { | |
| method: "POST", | |
| body: JSON.stringify({ | |
| filename: file.name, | |
| size: file.size, |
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
| export default const MyComponent => () => { | |
| const [formData, setFormData] = useState({}); | |
| const removeFormData = (path) => { | |
| setFormData(prev => { | |
| const newData = structuredClone(prev); | |
| const keys = path.split("."); | |
| let obj = newData; |
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
| <?php | |
| // Path to your protected video file (outside web root recommended) | |
| $videoFile = '/path/to/your/private/video.mp4'; | |
| // Check if the file exists | |
| if (!file_exists($videoFile)) { | |
| header("HTTP/1.1 404 Not Found"); | |
| exit; | |
| } |
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
| function lotto(slots, max, min) { | |
| slots = slots ?? 6; | |
| max = max ?? 60; | |
| min = min ?? 1; | |
| const numbers = new Set(); | |
| while (numbers.size < slots) { | |
| const num = Math.floor(Math.random() * max) + min; | |
| numbers.add(num); |
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
| name: Publish Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: github.event.release.draft == false |
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
| # Usa a versão específica do Node que está no .nvmrc | |
| FROM node:20.11.1-slim | |
| WORKDIR /app | |
| # Copia os arquivos | |
| COPY . . | |
| # Instala as dependências e builda o projeto | |
| RUN yarn install --frozen-lockfile |
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/bash | |
| PROFILE=my-profile | |
| REGION=us-east-1 | |
| CODE_REPOSITORIES=$(aws codecommit list-repositories --no-paginate --profile=$PROFILE --region=$REGION |jq -r .repositories[].repositoryName) | |
| for REPO in $CODE_REPOSITORIES; do | |
| NEW_REPO_NAME="${REPO}_deprecated" | |
| echo "- Reponame: ${REPO}; New name: ${NEW_REPO_NAME}" |
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/bash | |
| PERMISSION="push" # Can be one of: pull, push, admin, maintain, triage | |
| ORG="orgname" | |
| TEAM_SLUG="your-team-slug" | |
| # Get names with `gh repo list orgname` | |
| # Change "limit" if necessary | |
| gh repo list $ORG --limit 1000 --json name --json owner -q '.[] | "\(.owner.login)/\(.name)"' | while read -r REPO; do | |
| echo "Repo: ${REPO}\r\n" |
NewerOlder