Skip to content

Instantly share code, notes, and snippets.

View cvhau's full-sized avatar
🐪
Coding is a half of my life!

Cao Van Hau cvhau

🐪
Coding is a half of my life!
  • Ho Chi Minh
View GitHub Profile
@cvhau
cvhau / 90-nproc.conf
Last active September 15, 2015 02:16
Edit /etc/security/limits.d/90-nproc.conf to increase number of processes available to users in a Linux system. http://singztechmusings.wordpress.com/2011/07/11/ulimit-how-to-permanently-set-kernel-limits-in-linux/
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 8192
root soft nproc unlimited
* soft nofile 16384
* hard nofile 16384
@cvhau
cvhau / index.js
Created September 27, 2018 08:11 — forked from antixrist/index.js
vue-magnific. Magnific-popup wrapper for Vue.js
const _ = require('lodash');
const $ = require('jquery');
const Vue = require('vue');
require('jquery.magnific-popup');
module.exports = Vue.extend({
template: require('./tpl.html'),
props: {
show: {
type: Boolean,
@cvhau
cvhau / EloquentCheatSheet.md
Created July 8, 2019 15:40 — forked from avataru/EloquentCheatSheet.md
Eloquent relationships cheat sheet
@cvhau
cvhau / github-to-bitbucket
Created July 29, 2019 03:21 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@cvhau
cvhau / RUNBOOK.md
Created March 16, 2020 03:11 — forked from voxxit/RUNBOOK.md
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@cvhau
cvhau / README.md
Created April 6, 2020 03:56 — forked from kerryboyko/README.md
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@cvhau
cvhau / mysql-docker.sh
Created May 24, 2020 08:39 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@cvhau
cvhau / gist:ecbb8f3c04d17bc7caada1a1e111a351
Created June 9, 2020 01:54 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
@cvhau
cvhau / input-reset.css
Created July 9, 2020 07:57 — forked from Tombarr/input-reset.css
CSS to remove input pseudo-elements and normalize input styling cross-browser
/* All of our custom controls should be what we expect them to be */
input,
textarea {
-webkit-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box;
}
/*
Show overflow in Edge
@cvhau
cvhau / Laravel-Container.md
Created August 27, 2020 08:05
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).