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 | |
| $chars = ['A', 'B', 'C']; | |
| foreach ($chars as $h => $char) { | |
| foreach ($chars as $i => $char) { | |
| foreach ($chars as $j => $char) { | |
| foreach ($chars as $k => $char) { | |
| foreach ($chars as $l => $char) { | |
| echo $chars[$h].$chars[$i].$chars[$j].$chars[$k].$chars[$l]."\n"; |
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
| version: "3" | |
| services: | |
| db: | |
| image: mysql:5.7 | |
| environment: | |
| - MYSQL_ALLOW_EMPTY_PASSWORD=yes | |
| - MYSQL_DATABASE=laravel | |
| networks: | |
| - db-network | |
| redis: |
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
| Jenkins + Docker Installation (Ubuntu) | |
| ====================================== | |
| (Updated at JUNE2017) | |
| https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04 | |
| https://pkg.jenkins.io/debian-stable/ | |
| https://docs.docker.com/engine/installation/linux/ubuntu/#prerequisites | |
| https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
| https://plugins.jenkins.io/embeddable-build-status |
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
| #!groovy | |
| node { | |
| timestamps { | |
| try { | |
| stage("before install") { | |
| checkout scm | |
| def docker_job = "$env.JOB_NAME".replace('/', '_') | |
| sh "docker stack deploy -c docker-compose.yml $docker_job" | |
| sleep time: 30, unit: 'SECONDS' |
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
| apiVersion: kind.x-k8s.io/v1alpha4 | |
| kind: Cluster | |
| nodes: | |
| - role: control-plane | |
| - role: worker | |
| extraPortMappings: | |
| - containerPort: 30080 | |
| hostPort: 30080 | |
| listenAddress: "0.0.0.0" | |
| protocol: tcp |
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\Models\Misc; | |
| use Illuminate\Database\Eloquent\Model; | |
| trait EloquentModelCaching | |
| { | |
| /** | |
| * Return cache for eloquent model object |
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
| curl -X OPTIONS 'https://test.com/index.html' -H "Origin: https://www.google.com" -H "Access-Control-Request-Method: GET" -v | |
| sudo chmod -R u=rwX,go=rX ./app | |
| CREATE USER 'kevinkhew'@'%' IDENTIFIED BY 'KevinKhew'; | |
| GRANT ALL PRIVILEGES ON dbname.* TO 'kevinkhew'@'%'; | |
| FLUSH PRIVILEGES; | |
| SHOW GLOBAL STATUS |