Skip to content

Instantly share code, notes, and snippets.

View hnxvc's full-sized avatar
🎯
Focusing

H n x hnxvc

🎯
Focusing
View GitHub Profile
@hnxvc
hnxvc / nginx.conf
Created April 21, 2020 10:50 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@hnxvc
hnxvc / postgres-brew.md
Created November 29, 2019 11:09 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@hnxvc
hnxvc / shell_script_backup_restore_mysql
Created July 1, 2019 16:24
Backup and restore mysql
# Backup
mysqldump -uroot -p*** hoablog --single-transaction --quick --lock-tables=false > /root/backup/mysql/hoablog-$(date +%F).sql
cd /root/backup/mysql
git add .
git commit -m "Backup file"
git push origin master
#Restore
mysql -u root -p*** hoablog < /root/backup/mysql/hoablog-2019-06-08.sql
@hnxvc
hnxvc / letsencrypt_2019.md
Created May 28, 2019 17:13 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@hnxvc
hnxvc / .html
Created May 16, 2018 16:44
Demo for Duy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JavaScript RSA Encryption</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="../bin/jsencrypt.min.js"></script>
</head>
@hnxvc
hnxvc / wp-comment-walker
Created June 17, 2016 09:43 — forked from georgiecel/wp-comment-walker
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
@hnxvc
hnxvc / package.json
Last active July 5, 2016 12:41
package.json
{
"name": "gulp-build",
"version": "1.0.0",
"description": "Gulp build create by NguyenXuanHoa",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"browser-sync": "^2.13.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
@hnxvc
hnxvc / gulpfile.js
Last active July 5, 2016 12:41
gulpfile.js
'user strict';
var gulp = require('gulp');
var config = require('./gulpconfig')();
var gulpLoadPlugins = require('gulp-load-plugins');
var $ = gulpLoadPlugins({
pattern: '*'
});
// handle error
@hnxvc
hnxvc / gulpconfig.js
Last active July 5, 2016 12:41
gulpconfig.js
'user strict';
module.exports = function(){
var base = '../html/sass-template/';
var config = {
base : base,
js_vendors : [
base + 'vendors/jquery/jquery-1.12.4.js',
base + 'vendors/*.js',
base + 'vendors/**/*.js',
@hnxvc
hnxvc / sass-mediaqueries
Created May 26, 2016 02:56
sass-mediaqueries
// Author: Rafal Bromirski
// www: http://rafalbromirski.com/
// github: http://github.com/paranoida/sass-mediaqueries
//
// Licensed under a MIT License
//
// Version:
// 1.6.1
// --- generator ---------------------------------------------------------------