Skip to content

Instantly share code, notes, and snippets.

View ducntq's full-sized avatar
🏠
Working from home

Duc Nguyen ducntq

🏠
Working from home
  • Ho Chi Minh City, Vietnam
View GitHub Profile
function myFunction()
{
var gSalary = 12000000; // gross salary
var sInsurance = 8; // social insurance
var hInsurance = 1.5;
var uInsurance = 1;
var iDeduction = 9000000;
var ifPit;
var pRate = 5;
var finalResult;
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\DS1-KnowledgeBase_{postfix}]
"Driver"="C:\\Program Files\\MySQL\\Connector ODBC 5.2\\myodbc5w.dll"
"SERVER"="77.245.67.98"
"UID"="resalesuser1"
"PWD"="sqlpwd2lv"
"DATABASE"="KnowledgeBase_{postfix}"
"PORT"="3306"
"FOUND_ROWS"="1"
"BIG_PACKETS"="1"
"MULTI_STATEMENTS"="1"
@ducntq
ducntq / gist:8ce1a81d4e92f4d549c539296776e1be
Created August 17, 2016 15:15
nginx configuration for ghost
upstream ghost_doiqua {
server 127.0.0.1:2368;
keepalive 64;
}
proxy_cache_path /var/run/cache levels=1:2 keys_zone=STATIC:75m inactive=24h max_size=128m;
server {
listen 80;
server_name doiqua.co;
@ducntq
ducntq / wysiwyg-meta-box.php
Created September 9, 2016 13:30 — forked from retgef/wysiwyg-meta-box.php
How to add a Wordpress WYSIWYG editor to a meta box.
<?php
define('WYSIWYG_META_BOX_ID', 'my-editor');
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different
define('WYSIWYG_META_KEY', 'extra-content');
add_action('admin_init', 'wysiwyg_register_meta_box');
function wysiwyg_register_meta_box(){
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post');
}
@ducntq
ducntq / php-fpm
Last active December 3, 2016 04:06
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-fpm
# Description: starts the PHP FastCGI Process Manager daemon
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@ducntq
ducntq / server-setup.md
Last active December 3, 2016 04:53
Setup server

Hướng dẫn cài server

SSH vào server, sử dụng dụng acc quyền root.

Chuẩn bị

Cài thêm epel repo:

yum rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
@ducntq
ducntq / server-setup.md
Last active December 3, 2016 04:06
Setup server

Hướng dẫn cài server

SSH vào server, sử dụng dụng acc quyền root.

Chuẩn bị

Cài thêm epel repo:

yum rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =