Skip to content

Instantly share code, notes, and snippets.

View nhtua's full-sized avatar
👨‍✈️
looking for a co-pilot

Tua Nguyen nhtua

👨‍✈️
looking for a co-pilot
View GitHub Profile
@nhtua
nhtua / nginx-rtmp.conf
Created December 14, 2020 16:56
Config Nginx Rtmp
events {}
rtmp {
server {
listen 1935;
chunk_size 4096;
application multiple {
live on;
record off;
push rtmp://a.rtmp.youtube.com/live2/<live-stream-id>;
var isClicked = false;
var btn = document.querySelector('.btn.iso-load-more');
var isInViewport = function (elem) {
var bounding = elem.getBoundingClientRect();
return (
bounding.top >= 0 &&
bounding.left >= 0 &&
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
);
@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 18, 2024 06:19
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@nhtua
nhtua / script.easy-reading-truyenfull.vn.js
Created June 25, 2018 05:39
Make truyenfull.vn easy reading
// ==UserScript==
// @name Easy read TruyenFull.Vn
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://truyenfull.vn/*/chuong-*/*
// @grant none
// ==/UserScript==
@nhtua
nhtua / rabbitmq-installation-guide.md
Last active February 7, 2018 04:44
Install RabbitMQ
@nhtua
nhtua / SimpleHTTPServerWithUpload.py
Created December 14, 2017 10:37 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@nhtua
nhtua / run_woff2.sh
Created August 7, 2015 09:52
Convert multiple fonts to woff
#! /bin/bash
# Put this file into woff tool's dir, which was compiled before
# To convert multiple file, type:
# ./run_woff.sh /path/to/fonts/dir <format(otf|ttf)>
fontdir=$1
fontext=$2
files=($fontdir/*.$2)
for item in ${files[*]}
do
./woff2_compress $item
@nhtua
nhtua / run_woff.sh
Created August 7, 2015 09:45
Convert multiple fonts to woff
#! /bin/bash
#Put this file into woff tool's dir, which was compiled before
#To convert multiple file, type:
# ./run_woff.sh /path/to/fonts/dir <format(otf|ttf)>
fontdir=$1
fontext=$2
files=($fontdir/*.$2)
for item in ${files[*]}
do
@nhtua
nhtua / diigo.trick.js
Last active August 29, 2015 14:25
Make your diigo bookmarks private
//Run in console (press F12, click `Console` tab, paste and press Enter to run)
//NOTE:
// Scroll to end of page, choose 100 items/page.
// Run once for every page.
// After done; change page by your-self then run code again. (press Up Arrow to get pre-code)
var items = document.querySelectorAll(".editIcon");
var i = 0;
items[i].click();
var tBrowser = setInterval(function(){
@nhtua
nhtua / RandomStringGenerator.class.php
Last active October 21, 2016 09:26
[php] Generate ramdom string
<?php
namespace Utils;
/**
* Class RandomStringGenerator
* @package Utils
*
* Solution taken from here:
* http://stackoverflow.com/a/13733588/1056679