Skip to content

Instantly share code, notes, and snippets.

🛴
Working hard

Chien Tran tdchien

🛴
Working hard
Block or report user

Report or block tdchien

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am tdchien on github.
  • I am chientd (https://keybase.io/chientd) on keybase.
  • I have a public key ASCa5fOkJU0xUjPsFHxE3f-vGyxEg7Sor-cba2tQjpyOcwo

To claim this, I am signing this object:

View FlatToTreeConverter.php
<?php
namespace App\Libraries;
/**
* Class able to convert a flat array with parent ID's to a nested tree
*/
class FlatToTreeConverter
{
/**
@tdchien
tdchien / rambox_zalo.js
Last active Aug 24, 2019
Intergrate zalo with Rambox. This script is used update unread message for zalo on rambox
View rambox_zalo.js
function checkUnread() {
console.log('checkUnread run');
var msg = document.getElementById("message-tab");
var img = msg.querySelector(".tab-red-dot");
if ((img == null) || (img == undefined)) {
// rambox.clearUnreadCount();
document.title = originalTitle;
return;
}
var src = img.attributes["src"];
@tdchien
tdchien / OpenGitBashHere.bat
Created May 27, 2018
Get context menu Open Git bash here on window 7
View OpenGitBashHere.bat
@echo off
SET gbPath=d:\programs\git\git-bash.exe
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\git_bash" /t REG_SZ /v "" /d "Open Git bash here" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\git_bash" /t REG_EXPAND_SZ /v "Icon" /d "%gbPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\git_bash\command" /t REG_SZ /v "" /d "%gbPath%" /f
@reg add "HKEY_CLASSES_ROOT\Directory\background\shell\git_bash" /t REG_SZ /v "" /d "Open Git bash here" /f
@reg add "HKEY_CLASSES_ROOT\Directory\background\shell\git_bash" /t REG_EXPAND_SZ /v "Icon" /d "%gbPath%,0" /f
@tdchien
tdchien / OpenWithSublimeText3.bat
Created May 20, 2018 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
View OpenWithSublimeText3.bat
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@tdchien
tdchien / PDO Binding param.php
Created Oct 23, 2017
PDO Binding param.php
View PDO Binding param.php
<?php
$dbh = null;
try {
$dbh = new PDO('mysql:host=localhost;dbname=webcms', 'webcms', 'webcms');
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
@tdchien
tdchien / User Setting.vscode
Last active Oct 27, 2017
My setting for VSCode
View User Setting.vscode
{
"editor.fontSize": 14,
"editor.lineHeight": 23,
"editor.fontFamily": "'Droid Sans Mono', Consolas, monospace, 'Courier New'",
"files.eol": "\n",
// php-cs-fixer
"php-cs-fixer.executablePath": "php-cs-fixer",
"php-cs-fixer.executablePathWindows": "php-cs-fixer.bat", //eg: php-cs-fixer.bat
"php-cs-fixer.onsave": false,
@tdchien
tdchien / list extensions.vscode
Created Oct 21, 2017
List of favorites extensions using with Microsoft Visual Studio Code
View list extensions.vscode
alefragnani.project-manager
Compulim.compulim-vscode-closetag
donjayamanne.githistory
EditorConfig.EditorConfig
emmanuelbeziat.vscode-great-icons
felixfbecker.php-debug
felixfbecker.php-intellisense
felixfbecker.php-pack
ikappas.phpcs
joelday.docthis
@tdchien
tdchien / SublimeLinter.sublime-settings
Created Oct 16, 2017
SublimeLinter.sublime-settings
View 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 Oct 18, 2017
Package Control List
View package_control.json
[
"Agila Theme",
"Alignment",
"All Autocomplete",
"Blade Snippets",
"Bootstrap 3 Autocomplete",
"Bootstrap 3 Snippets",
"CodeIgniter 2 ModelController",
"CodeIgniter Snippets",
"CodeIgniter Utilities",
You can’t perform that action at this time.