Skip to content

Instantly share code, notes, and snippets.

View hoangnamitc's full-sized avatar

hoangnamitc hoangnamitc

View GitHub Profile
@hoangnamitc
hoangnamitc / subl-terminal.txt
Last active March 8, 2022 15:07
Open SublimeText with Terminal
Terminal run code:
````
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
````
DONE !
(for any site)
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
(with WordPress) - (replace line: "RewriteEngine On")
@hoangnamitc
hoangnamitc / php-ini-setting.txt
Created June 26, 2021 04:25
Các thông số PHP settings lý tưởng
-------------------------------
Xem php.init ở đâu: php --ini
- post_max_size : 750M
- upload_max_filesize : 750M (Dung lượng tối đa cho việc upload file)
- max_execution_time : 120 (Thời gian tối đa để thực thi 1 tác vụ PHP "giây")
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
- Mở Automator
- Tạo mới "Service" (Quick Action)
- Thêm một action "Run Shell Script"
- Mục Workflow receives current bạn chọn: "files or folders" in "Finder.app"
- Mục Run Shell Script:
+ Shell chọn: /bin/bash
+ Pass input chọn: as arguments
+ nội dung nhập:
for f in "$@"; do
- Mở Automator
- Quick Action
- Tạo mới "Service"
- Thêm một action "Run Shell Script"
- Mục Workflow receives current bạn chọn: "files or folders" in "Finder"
- Mục Run Shell Script:
+ Shell chọn: /bin/bash
+ Pass input chọn: as arguments
+ nội dung nhập:
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -a "$@"
# Sau khi cài xong mà ko gõ được lệnh composer thì chạy lệnh sau:
sudo mv composer.phar /usr/local/bin/composer
@hoangnamitc
hoangnamitc / php-install.txt
Last active November 24, 2023 02:25
PHP Installation
# Cài thư viện
brew tap shivammathur/php
-------------------------------------------------------------------------------
# Cài phiên bản
brew install shivammathur/php/php@5.6
brew install shivammathur/php/php@7.0
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.3
Source: https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions
------------------------------------------------------------------------------------------------
# Tắt Apache mặc định của OSX
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
------------------------------------------------------------------------------------------------
# Cài Apache mới
brew install httpd
------------------------------------------------------------------------------------------------