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 / eloquentStandAlone.php
Last active August 29, 2015 14:17
Eloquent Model Event
// Database connector
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
/**
* Configure the database and boot Eloquent
*/
global $capsule;
$capsule = new Capsule;
$capsule->addConnection(array(
'driver' => getenv('DB_DRIVER'),
@tdchien
tdchien / app-config-blade.php
Last active August 29, 2015 14:26 — forked from dshoreman/app-config-blade.php
Custom loader class for CodeIgniter that implements Laravel's Blade templating engine
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['views_path'] = APPPATH . 'views/blade/';
$config['cache_path'] = APPPATH . 'cache/blade/';
@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
*/
// History.js It!
// v1.0.1 - 30 September, 2012
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
@tdchien
tdchien / symlink.php
Created November 24, 2016 17:24
Symlink for laravel storage
@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 / 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 / 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 / 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",