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
| // These tests show the various ways to spawn child threads | |
| // and in what scenarios the value in the AsyncLocal or | |
| // logical CallContext will flow to the child threads. | |
| // All of the below test results are identical if you | |
| // use the old CallContext.LogicalSetData CallContext.LogicalGetData | |
| void Main() | |
| { | |
| // Set the AsyncLocal value and we'll see where this flows |
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 | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\BelongsTo; | |
| use Illuminate\Database\Eloquent\Relations\BelongsToMany; | |
| use Illuminate\Database\Eloquent\Relations\HasOneOrMany; | |
| trait CanUpdateRelations | |
| { | |
| public function newInstanceWithRelations($attributes = []) |
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 | |
| use Illuminate\Database\Eloquent\Builder; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Query\Builder as QueryBuilder; | |
| use Illuminate\Support\Arr; | |
| use Illuminate\Support\Facades\DB; | |
| trait HasAutoIncByField | |
| { |
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 | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\File; | |
| use Illuminate\Support\Facades\Lang; | |
| use Symfony\Component\Finder\SplFileInfo; | |
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
| #!/usr/bin/env bash | |
| mkdir projectAOSTW | |
| cd projectAOSTW || exit | |
| git clone https://github.com/m-nic/aostw.git | |
| cd aostw || exit | |
| wget https://gist.githubusercontent.com/m-nic/a0f1bebf4726bf2691a88f821adb05c6/raw/16872d118dc9a52ccb7155690c64a7ace1bad459/add_site.sh | |
| bash add_site.sh service.aostw.localhost |
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
| #!/usr/bin/env bash | |
| sudo apt update | |
| # Install apache | |
| sudo apt install -y apache2 | |
| # sudo systemctl enable apache2.service | |
| sudo systemctl start apache2.service | |
| # Install PHP | |
| sudo apt-get install software-properties-common |
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
| var host = "127.0.0.1"; | |
| var port = 8080; | |
| var express = require("express"); | |
| var fs = require('fs'); | |
| var app = express(); | |
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
| #!/usr/bin/python | |
| from flask import Flask, request, redirect, url_for, send_from_directory | |
| # Setup Flask app. | |
| app = Flask(__name__) | |
| app.debug = True | |
| # Routes |
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
| #!/usr/bin/env bash | |
| if [ -z "$1" ] && [ -z "$2" ]; then | |
| echo "Enter domain name and document root" | |
| else | |
| sandboxHost="$1" | |
| documentRoot="`pwd`/$2" | |
| apacheConf="/etc/apache2/sites-available/$sandboxHost.conf" |
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
| #!/usr/bin/env bash | |
| sudo mysql -e "CREATE USER '$1'@'localhost' IDENTIFIED WITH mysql_native_password BY '$2'; GRANT ALL PRIVILEGES ON * . * TO '$1'@'localhost'; FLUSH PRIVILEGES;" -p |
NewerOlder