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
# Using vim | |
:%s/-\(.\)/\U\1/g | |
# Explain: Search for pattern -(.) and turn uppercase the first group \U\1 |
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 | |
* Author: Thanh Tran (int3ractive.com) | |
*/ | |
.image1 { | |
background: url(http://labs.int3ractive.com/javascript/effects/stereo-images/img/DSC_0192.jpg) no-repeat; | |
width: 512px; | |
height: 769px; | |
} |
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
/** | |
* Flex-box playground | |
*/ | |
body { font: 2em sans-serif; } | |
.s1 { font-size: 1em; } | |
.s2 { font-size: 2em; } | |
.s3 { font-size: 1.5em; } | |
.box { | |
background: #ffcccc; |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.box { | |
width: 200px; | |
height: 200px; | |
background: rgba(255,0,255, 0.2); | |
} |
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; |
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
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
# 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
/** | |
* (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
#!/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 |