Skip to content

Instantly share code, notes, and snippets.

View vuthaihoc's full-sized avatar
🤒
ke ke ặc ặc

Stupid Dev vuthaihoc

🤒
ke ke ặc ặc
View GitHub Profile

Tài liệu gốc : Tiềm năng và hiện trạng phát triển du lịch tại thành phố Buôn Mê Thuột, tỉnh Đắc Lắc

Dàn ý chi tiết tóm tắt tài liệu "Tiềm năng và hiện trạng phát triển du lịch tại thành phố Buôn Mê Thuột, tỉnh Đắc Lắc"

Tổng số chữ dự kiến: ~2000 chữ

Lưu ý: Dàn ý này chia nội dung thành các phần chính với số chữ gợi ý để đảm bảo độ chi tiết và phân bổ nội dung hợp lý. Bạn có thể điều chỉnh số chữ cho phù hợp với yêu cầu của mình.

Chương 1: Cơ sở lý luận về khai thác tài nguyên du lịch cho phát triển du lịch (~300 chữ)

@vuthaihoc
vuthaihoc / AdvancedCommandCallTrait.php
Created August 2, 2023 04:59
Call artisan command with timeout
<?php
namespace App\Console\Commands;
use Illuminate\Support\Facades\Process;
trait AdvancedCommandCallTrait
{
protected function advancedCallCommand($command, $parameters = [], $timeout = 300, $idleTimeout = 120) : void
{
@vuthaihoc
vuthaihoc / DbReplicate.php
Last active April 13, 2023 05:20
Laravel DB replicate
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Symfony\Component\Console\Output\ConsoleSectionOutput;
class DbReplicate extends Command
{
@vuthaihoc
vuthaihoc / create_db.php
Created June 2, 2022 10:02
create db deployer task
<?php
namespace Deployer;
use Dotenv\Dotenv;
task('db:create', function(){
$region = get('region');
if(!$region){
$region = ask("Region", "");
@vuthaihoc
vuthaihoc / AppServiceProvider.php
Last active May 6, 2022 08:18
Add CLI_MEMORY_LIMIT to change memory_limit of php when run commands as scheduled task
<?php
// app/Providers/AppServiceProvider.php
// ....
public function boot(){
if ($this->app->runningInConsole()) {
$this->setMemoryLimit();
}
<?php
namespace App\Models\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class CountryScope implements Scope
{
@vuthaihoc
vuthaihoc / docker-compose.yml
Created March 9, 2022 16:49
Run cockroachdb cluster with docker
version: "3"
services:
crdb1:
image: cockroachdb/cockroach:v21.2.6
ports:
# - "26257:26257"
- "8889:8080"
command: start --certs-dir=/cockroach/certs --join crdb1,crdb2,crdb3 --accept-sql-without-tls --store=path=/cockroach/cockroach-data,size=1G --listen-addr=crdb1
@vuthaihoc
vuthaihoc / backup.sh
Created October 12, 2021 18:26
Dump db and put to s3 by minio client
#!/bin/bash
# file /var/www/backup.sh
# Run `cd /var/www && sh backup.sh`
# This script is used for laravel projects deployed by deployer php
function run_backup(){
export $(cat current/.env | sed 's/#.*//g' | xargs)
@vuthaihoc
vuthaihoc / pdftitle.py
Last active May 25, 2021 01:40 — forked from TestItOnlyOnce/pdftitle.py
Rename pdf files to their content's titles (for Python 3; with wildcard support; default rename all pdfs)
#!/usr/bin/env python
"""
Extracts title from PDF files (Python 3).
Depends on: pdf, pyPDF2, PDFMiner3k, unidecode.
Usage:
pdftitle -d tmp --rename *.pdf{}
"""
from io import StringIO