curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
This file contains 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 | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\DB; | |
function chuckFile(string $filePath, callable $callable, int $chuckSize) | |
{ | |
$file = fopen($filePath, 'r'); | |
$data = []; |
This file contains 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
cd ${FORGE_SITE_PATH} | |
# Maintenance mode | |
$FORGE_PHP artisan down || true | |
# Clean up | |
$FORGE_PHP artisan horizon:pause | |
$FORGE_PHP artisan auth:clear-resets | |
$FORGE_PHP artisan optimize:clear | |
git checkout . |
This file contains 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
cd ${FORGE_SITE_PATH} | |
# Maintenance mode | |
$FORGE_PHP artisan down || true | |
# Clean up | |
$FORGE_PHP artisan optimize:clear | |
git checkout . | |
# Fetch latest |
This file contains 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 | |
namespace App\Models\Traits; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Database\Eloquent\Casts\Attribute; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Str; | |
use Ramsey\Uuid\Uuid; |
This file contains 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
// Clear or truncate log files | |
truncate -s 0 /var/log/*.log | |
truncate -s 0 /var/log/**/*.log | |
find /var/log -type f -name '*.log' -exec truncate -s 0 {} + | |
find /var/log -type f -iname '*.log' -print0 | xargs -0 truncate -s0 |
This file contains 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 Example | |
{ | |
public function handle() | |
{ | |
$this->sendHeader('test.csv'); | |
$this->sendData(['foo', 'bar', 'foobar'], [ | |
['a', 'b', 'c'], | |
['d', 'e', 'f'], |
This file contains 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
<?xml version="1.0"?> | |
<psalm | |
totallyTyped="true" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="https://getpsalm.org/schema/config" | |
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | |
> | |
<projectFiles> | |
<directory name="app" /> | |
</projectFiles> |
I hereby claim:
- I am jewei on github.
- I am jewei (https://keybase.io/jewei) on keybase.
- I have a public key ASC2ykLyNwPS-jO8LiLFD2bbKN-k6XcdFZaGtLkJ0GgZFwo
To claim this, I am signing this object:
This file contains 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
// Set timezone. | |
sudo dpkg-reconfigure tzdata | |
// Update. | |
sudo apt update | |
// Language fix. | |
sudo apt install -y language-pack-en-base | |
export LC_ALL=en_US.UTF-8 |
NewerOlder