title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
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
| """ | |
| The most atomic way to train and inference a GPT LLM in pure, dependency-free Python. | |
| Differences from GPT-2 are minor: rmsnorm instead of layer norm, no biases, square ReLU instead of GeLU nonlinearity. | |
| The contents of this file is everything algorithmically needed to train a GPT. Everything else is just efficiency. | |
| Art project by @karpathy. | |
| """ | |
| import os # for os.path.exists | |
| import math # for math.log, math.exp | |
| import random # for random.seed, random.choices |
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 | |
| // Make sure the PCNTL extension is available | |
| if (!function_exists('pcntl_fork')) { | |
| die("PCNTL functions not available. Please install the PCNTL extension.\n"); | |
| } | |
| // Create a temp directory for process communication | |
| $tempDir = sys_get_temp_dir() . '/pcntl_' . uniqid(); | |
| mkdir($tempDir, 0755, true); |
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 | |
| /** | |
| * Class PIIMasker | |
| * | |
| * This class provides methods to mask or anonymize Personally Identifiable Information (PII). | |
| * Masking involves partial replacement for readability, while anonymization uses hashing for irreversibility. | |
| * It's recommended to use anonymization for storing data securely. | |
| */ | |
| class PIIMasker |
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 -e | |
| vendor/bin/phpunit | |
| (git push) || true | |
| git checkout production | |
| git merge master |
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: Laravel Vapor CD | |
| on: | |
| release: | |
| types: [ published, deleted ] | |
| branches: | |
| - master | |
| jobs: | |
| deploy_release: | |
| runs-on: ubuntu-20.04 |
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: Preview Environment | |
| on: | |
| pull_request: | |
| types: [opened] | |
| env: | |
| FORGE_API_TOKEN: ${{ secrets.FORGE_API_TOKEN }} | |
| FORGE_SERVER_ID: ${{ secrets.FORGE_SERVER_ID }} |
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 | |
| function quadraticRegression($dataPoints) { | |
| $sumX = 0; | |
| $sumX2 = 0; | |
| $sumX3 = 0; | |
| $sumX4 = 0; | |
| $sumY = 0; | |
| $sumXY = 0; | |
| $sumX2Y = 0; | |
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 | |
| function polyfit($dependentValues, $independentValues, $countOfElements, $order, &$coefficients) | |
| { | |
| // Declarations... | |
| // ---------------------------------- | |
| $maxOrder = 5; | |
| $B = array_fill(0, $maxOrder + 1, 0.0); | |
| $P = array_fill(0, (2 * ($maxOrder + 1)) + 1, 0.0); | |
| $A = array_fill(0, (2 * ($maxOrder + 1)) * ($maxOrder + 1), 0.0); |
NewerOlder