Skip to content

Instantly share code, notes, and snippets.

View lamngockhuong's full-sized avatar
🍊
Working

Lâm Ngọc Khương lamngockhuong

🍊
Working
View GitHub Profile
@lamngockhuong
lamngockhuong / change-owner-directory-linux.md
Last active January 7, 2018 04:31
[Change ower of directory from root to your current user account] #ubuntu #linux

Example with android studio:

sudo chown -R $USER:$USER /opt/android-studio

Here is the command, where $USER will change by itself to your current active user


@lamngockhuong
lamngockhuong / config-auto-login-phpmyadmin.md
Created January 6, 2018 08:29
[Config auto login phpmyadmin] #phpmyadmin #xampp
  1. Goto "phpmyadmin" folder, find and open "config.inc.php" file (Location : /etc/phpmyadmin/config.inc.php on linux)
  2. Find the line: $cfg [‘Servers’] [$a] [‘auth_type’] = ‘cookie’; in “config.inc.php” file.
  3. Replace the line of code by blow code:
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['username'] = 'root';
$cfg['Servers'][$i]['password'] = 'your_password';

If your password null or '' the uncomment the blow line

@lamngockhuong
lamngockhuong / README.md
Last active January 5, 2018 12:07
[A template to make good README.md] #markdown

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@lamngockhuong
lamngockhuong / custom-pagination.md
Last active December 29, 2017 09:09
[Laravel Custom Pagination] #laravel

custom.blade.php

@if ($paginator->hasPages())
    <ul class="pagination pagination-sm no-margin pull-right">
        {{-- Previous Page Link --}}
        @if ($paginator->onFirstPage())
            <li class="disabled"><span>«</span></li>
        @else
            <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
        @endif
@lamngockhuong
lamngockhuong / phpcs-subl.md
Last active December 30, 2017 16:41
[Using PHPCS with Sublime Text] #sublimetext #ide #phpcs #lamngockhuong
@lamngockhuong
lamngockhuong / DatabaseConnection.java
Last active December 29, 2017 09:46
[Database Connection Util] #java #connection
package util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
* https://ngockhuong.com
*/
@lamngockhuong
lamngockhuong / bash.md
Last active May 11, 2018 01:32
[Show your branch name on your terminal] #bash #linux #ubuntu #git

Add these lines in your ~/.bashrc file

# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
@lamngockhuong
lamngockhuong / command.md
Last active December 30, 2017 16:30
[Laravel Commands] #laravel
Create new site with laravel:
laravel new blog
Run artisan server
php artisan serve
@lamngockhuong
lamngockhuong / lampp.md
Last active December 30, 2017 16:30
[LAMP control on linux] #linux #lamp #apache #mysql #terminal #ubuntu

LAMPP NOTE

Apache

Start apache

sudo systemctl start apache2 or sudo service apache2 start or sudo /etc/init.d/apache2 start

Restart apache

@lamngockhuong
lamngockhuong / note.md
Last active December 30, 2017 16:31
[How to fix CSRF token not found on console: app.js:1 CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token] #php #laravel