Skip to content

Instantly share code, notes, and snippets.

View anhphamt's full-sized avatar

Phamazing anhphamt

View GitHub Profile
@anhphamt
anhphamt / common.sublime-completions
Last active May 9, 2016 14:34
Sublime text 3 snippets and completions
{
"scope": "source.php",
"completions":
[
{ "trigger": "dbg", "contents": "echo '<pre>'. print_r($0, true) . '</pre>'; \ndie();" },
]
}
@anhphamt
anhphamt / compat_l5.php
Created July 28, 2016 02:52 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@anhphamt
anhphamt / update_header_openssl.md
Last active November 5, 2016 18:19
Update header OpenSSL "El Capitan" and build MongoDB Driver PHP

Apple removed the OpenSSL header files in "El Capitan", making it hard to build OpenSSL-dependent libraries without modifying your system a little bit.

I find a solution for it https://solitum.net/openssl-os-x-el-capitan-and-brew/

$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl
@anhphamt
anhphamt / configure_vhost_xampp_osx.md
Last active March 20, 2019 15:40
Configure Virtual Host XAMPP OSX

Open file /Applications/XAMPP/xamppfiles/etc/httpd.conf and uncomment

#Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
sudo nano /Applications/XAMPP/etc/extra/httpd-vhosts.conf
sudo nano /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
@anhphamt
anhphamt / run_2_skype_account.md
Last active October 22, 2016 02:51
Run 2 skype accounts in OSX

Run this command in Terminal:

sudo /Applications/Skype.app/Contents/MacOS/Skype
@anhphamt
anhphamt / run_phpunit_osx.md
Created October 30, 2016 17:38
Run phpunit in Lumen project
@anhphamt
anhphamt / fix_php_cs_fixer.md
Last active October 31, 2016 09:53
Fix php_cs_fixer change the first character to lower case

Package Settings -> PHP Code Sniffer -> Settings - User):

"php_cs_fixer_additional_args": { "--fixers": "-psr0" },

This will prevent some potential error with Reflection Class in PHP (Queue on Laravel and Lumen will not work)

@anhphamt
anhphamt / show_hide_hidden_files.md
Created November 6, 2016 13:14
Show/Hide hidden files/folders in OSX

Open your terminal and run this command: ** Show Hidden Files

defaults write com.apple.finder AppleShowAllFiles YES

** Hide Hidden Files/Folders

defaults write com.apple.finder AppleShowAllFiles NO
@anhphamt
anhphamt / composer_forked_repository.md
Created November 7, 2016 03:43
How to composer with a fork repository