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
name: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- master # Specify the branches that should trigger the workflow | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-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\DTO; | |
use App\Interfaces\ActionServiceDTOInterface; | |
use Illuminate\Support\Str; | |
class BaseDto | |
{ | |
public function __construct(?array $data = null) |
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
# Add secret | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: mysql-secret | |
type: Opaque | |
data: | |
MYSQL_ROOT_PASSWORD: bXlwYXNzd29yZAo= |
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
version: '3.8' | |
services: | |
app: | |
image: nginx | |
volumes: | |
- "./docker/nginx/sites/:/etc/nginx/conf.d" | |
ports: | |
- "80:80" | |
networks: |
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
upstream authUpstream { | |
server auth:9090 max_fails=0 fail_timeout=10s; | |
keepalive 512; | |
} | |
upstream service1Upstream { | |
server services1:9091 max_fails=0 fail_timeout=10s; | |
keepalive 512; | |
} |
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
# for select duplicate | |
SELECT * FROM `lb` t1, `users` t2 WHERE t1.user_id = t2.id AND t2.dff_stm = 1 ; | |
# for delete duplicate | |
DELETE t1 FROM `lb` t1, `users` t2 WHERE t1.user_id > t2.id AND t2.dff_stm = 1 |
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
version: '3.1' | |
services: | |
db_mysql: | |
image: mysql | |
command: | |
- --default-authentication-plugin=caching_sha2_password | |
restart: always | |
environment: |
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
DO | |
$$ | |
DECLARE | |
rec RECORD; | |
lastId INT; | |
BEGIN | |
FOR rec IN (SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT current_schema()) | |
AND table_type = 'BASE TABLE') |
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
function power(base, exponent) { | |
let result = 1; | |
for (let i = 0; i < Math.floor(exponent); i++) { | |
result *= base; | |
} | |
if (exponent % 1 !== 0) { | |
result *= base ** (exponent % 1); | |
} | |
return result; | |
} |
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
function sqrt(number) { | |
if (number < 0) { | |
throw new Error("Square root of a negative number is undefined"); | |
} | |
let guess = number / 2; | |
const precision = 0.0001; // Adjust the precision as needed | |
while (Math.abs(guess * guess - number) > precision) { | |
guess = (guess + number / guess) / 2; |
NewerOlder