Skip to content

Instantly share code, notes, and snippets.

View trongthanh's full-sized avatar
🎈
Keep calm and code on

Thanh Tran trongthanh

🎈
Keep calm and code on
View GitHub Profile
@trongthanh
trongthanh / dabblet.css
Created December 10, 2014 04:37 — forked from oli/dabblet.css
Animations plus animations/transitions
/* Animations plus animations/transitions */
/* ref: http://mattwilcox.net/sandbox/css3-animations-1/index.htm */
/* also ref: http://css-tricks.com/restart-css-animation/ */
.animate-on-load {animation: bgcolor 3s;}
.animate-on-hover:hover {animation: bgcolor 3s;}
.animate-on-hover2:hover {animation: bgcolor2 3s;} /* change anim name */
.animate-on-hover3:hover {animation: bgcolor 2.9s;} /* change duration */
.animate-on-hover4:hover {animation: bgcolor 3s 2;} /* change iteration-count */
.transition-on-hover {transition: background-color 2s;}
.transition-on-hover:hover {background-color: #777;}
@trongthanh
trongthanh / vn-front-end-libraries.md
Last active August 29, 2015 14:13
Front End Libraries by Vietnamese Developers

I'm not recommending nor disapproving any of these libraries. I'm listing these libraries / frameworks for just the fact that they were created by Vietnamese developers and I respect them for their hardwork and sharing with community:

  1. HTMLJS by nhanfu: A MVVM framework
  2. jQuery.longShadow by dangvanthanh: A jQuery plugin to create long casting shadows on text
  3. SickelS by singggum3b: A responsive web framework
@trongthanh
trongthanh / fetch-data.js
Created October 19, 2016 06:26
Intro to GraphQL
/**
* Client-side GraphQL data fetch example with HTML5 Fetch API
*
* @param {String} url URL to the GraphQL endpoint
* @param {String} query The GraphQL query
* @return {Promise} the request resolving promise object
*/
function fetchData(url = 'http://localhost:3000/graphql', query = '{ hello }') { //eslint-disable-line no-unused-vars
let requiredHeaders = new Headers({
'Content-Type': 'application/json',
@trongthanh
trongthanh / initialize.sh
Last active May 17, 2020 10:41
Ubuntu Node Server Setup
#!/bin/bash
# NOTE: The commands here only applicable for Ubuntu 16.04 Xenial, do not use it for other distros
# Update server to latest packages
sudo apt update && sudo apt upgrade -y
# Install nginx and git
sudo apt install -y nginx git
# initialization file (not found)
@trongthanh
trongthanh / index.js
Last active July 11, 2017 04:02
Read a News table (exported from MS SQL Server in Unicode format) and convert to static HTML pages
/**
* (c) 2017 Thanh Tran
*
* Node script to convert a SQL Server table of News article to a static HTML site (for archive purpose)
*
* The SQL Server management tool extract the table to flat text file with below specs:
* - Row delimiters: {CR} \r
* - Col delimiters: {|} vertical bars
* - Unicode encoding (UTF-16)
* By Windows OS nature, HTML content in Contents column has new lines with CRLF sequence.
@trongthanh
trongthanh / init-goalify-chat-server.sh
Created March 5, 2018 08:11
Goalify Chat server instance init
#!/bin/bash
# NOTE: The commands here only applicable for Ubuntu 16.04 Xenial, do not use it for other distros
# Get user inputs for some customizable variables
# NOTE: map domain to this VPS instance first
read -p "Domain: " DOMAIN
# Update server to latest packages
sudo apt update && sudo apt upgrade -y
@trongthanh
trongthanh / mojave.xml
Last active May 9, 2025 13:17
macOS Mojave dynamic background re-implement as GTK+ background slideshow. Background images are changed to reflect the time of the day.
<!-- Instructions:
- Download and unzip Mojave dynamic background here: https://files.rb.gd/mojave_dynamic.zip
- Rename the extracted folder as "mojave-background" (Excuse the trouble but I renamed it on my machine and already use that path in the XML file)
- Save this xml file next to the Mojave background files
- Fix the path to the background images below (better using absolute path)
- Lastly, either:
+ GNOME: Use gnome-tweaks tool to select this XML as wallpaper (as default wallpaper settings won't let you choose wallpaper from custom path)
+ MATE: Go to background setting (in Appearance) > Choose +Add... > make sure **All files** filter is selected at the bottom right > Then choose mojave.xml
-->
<background>
@trongthanh
trongthanh / tizonia_aliases.sh
Last active August 9, 2018 04:36
Tizonia aliases
# Tizonia aliases
alias ti="tizonia"
function tis() {
echo "Shortcuts for tizonia --spotify-*"
echo "tistr arg Search and play from Spotify by track name."
echo "tisar arg Search and play from Spotify by artist name."
echo "tisal arg Search and play from Spotify by album name."
echo "tispl arg Search and play public playlists (owner is assumed current user, unless --spotify-owner is provided)."
echo "tisop ow pl Search and play public playlist by an owner"
@trongthanh
trongthanh / index.html
Created October 13, 2018 08:10
jquery-handlebars-boilerplate
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>MY PAGE TITLE HERE</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.4/handlebars.js"></script>
<script>
$(function() {