Skip to content

Instantly share code, notes, and snippets.

View tdchien's full-sized avatar
🛴
Working hard

Chien Tran tdchien

🛴
Working hard
View GitHub Profile
@tdchien
tdchien / SublimeLinter.sublime-settings
Created October 16, 2017 15:44
SublimeLinter.sublime-settings
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"php": {
@tdchien
tdchien / package_control.json
Last active October 18, 2017 08:49
Package Control List
[
"Agila Theme",
"Alignment",
"All Autocomplete",
"Blade Snippets",
"Bootstrap 3 Autocomplete",
"Bootstrap 3 Snippets",
"CodeIgniter 2 ModelController",
"CodeIgniter Snippets",
"CodeIgniter Utilities",
@tdchien
tdchien / Visual C++ for php.md
Last active June 20, 2018 08:41
Visual C++ collection for multiply php version on window

VC11, VC14 & VC15

More recent versions of PHP are built with VC11, VC14 or VC15 (Visual Studio 2012, 2015 or 2017 compiler respectively) and include improvements in performance and stability.

  • The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed
  • The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed
  • The VC15 builds require to have the Visual C++ Redistributable for Visual Studio 2017 x64 or x86 installed

TS and NTS

TS refers to multithread capable builds. NTS refers to single thread only builds. Use case for TS binaries involves interaction with a multithreaded SAPI and PHP loaded as a module into a web server. For NTS binaries the widespread use case is interaction with a web server through the FastCGI protocol, utilizing no multithreading (but also for example CLI).

VC9 Packages (Visual C++ 2008 SP1)

@tdchien
tdchien / virtualhost
Created September 11, 2017 03:33
Virtualhost
<VirtualHost *:80>
ServerName laravel.demo
DocumentRoot "D:/www/kloon_training/demo_laravel/public"
<Directory "D:/www/kloon_training/demo_laravel/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
@tdchien
tdchien / Default (Windows).sublime-keymap
Last active July 10, 2017 15:06
Some key-map for sublime on window
[
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
{ "keys": ["ctrl+shift+r"], "command": "reveal_in_side_bar"},
{"keys": ["f1"], "command": "dired", "args": { "immediate": true } }
]
@tdchien
tdchien / SublimeLinter.sublime-settings
Last active October 12, 2017 03:33
SublimeLinter Setting with Sublime Text 3. View more at https://github.com/SublimeLinter/SublimeLinter-php
{
"close_windows_when_empty": false,
"color_scheme": "Packages/User/SublimeLinter/Agila Dracula (SL).tmTheme",
"default_line_ending": "unix",
"detect_indentation": true,
"detect_slow_plugins": false,
"drag_text": true,
"draw_white_space": "all",
"fallback_encoding": "UTF-8",
"folder_exclude_patterns":
@tdchien
tdchien / symlink.php
Created November 24, 2016 17:24
Symlink for laravel storage
@tdchien
tdchien / EventServiceProvider.php
Created November 17, 2016 14:53
Laravel 5 - Log DB query
public function boot(DispatcherContract $events)
{
parent::boot($events);
$path = storage_path().'/logs/query.log';
\Event::listen('illuminate.query', function($sql, $bindings, $time) use($path) {
// Uncomment this if you want to include bindings to queries
//$sql = str_replace(array('%', '?'), array('%%', '%s'), $sql);
//$sql = vsprintf($sql, $bindings);
$time_now = date('Y-m-d H:i:s');
@tdchien
tdchien / Preferences.sublime-settings
Last active December 31, 2017 07:41
Sublime Text 3 - User setting
{
"color_scheme": "Packages/Agila Theme/Agila Dracula.tmTheme",
"default_line_ending": "unix",
"detect_indentation": true,
"detect_slow_plugins": false,
"drag_text": false,
"draw_white_space": "all",
"fallback_encoding": "UTF-8",
"font_size": 11,
"highlight_line": false,
@tdchien
tdchien / helpers.php
Created November 2, 2015 13:26 — forked from mabasic/helpers.php
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/