This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Note: I have forked this gist from @getify to rewrite it with variable naming with closer association with hook and state | |
* and added some comments of my own so that it is easier to follow | |
* A demo is live at: https://codepen.io/trongthanh/pen/WaqqoJ?editors=0012 | |
*/ | |
'use strict'; | |
[foo, bar] = enableHooks(foo, bar); | |
function foo(origX, origY) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Visit: http://jsfiddle.net/ttt_conan/bzqnu/ for live demonstration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* (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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialization file (not found) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( | |
['TodoItem'], | |
function(TodoItem) { | |
'use strict'; | |
// constants | |
var ENTER_KEY = 13; | |
function AppView($el) { | |
this.$el = $el; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Demo: Fixed Web Font padding issues on Mac/Linux/Android | |
Blog post: http://blog.int3ractive.com/2013/07/fixing-web-fonts-padding-issues-on-linux-mac.html | |
*/ | |
@font-face { | |
font-family: 'HelveticaLight'; font-weight: normal; font-style: normal; | |
src: local('☺'), url('https://github.com/trongthanh/trongthanh.github.com/blob/master/css/webfonts-padding-fix/HelveticaNeue-Light.woff?raw=true') format('woff'); | |
} | |
@font-face { | |
font-family: 'HelveticaLightFixed'; font-weight: normal; font-style: normal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Animated 3D Stereo Images with CSS3 (Enhanced with Steps) | |
* Author: Thanh Tran (int3ractive.com) | |
* Blog post: http://blog.int3ractive.com/2012/05/cave-3d-stereo-images-2-state-looping.html | |
* Older solution (without steps() function): http://dabblet.com/gist/2651495 | |
* Note: prefix-free in use | |
*/ | |
.image1 { | |
background: url(http://labs.int3ractive.com/javascript/effects/stereo-images/img/DSC_0192.jpg) no-repeat; |