Skip to content

Instantly share code, notes, and snippets.

View bhongy's full-sized avatar

Thanik Bhongbhibhat bhongy

View GitHub Profile
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
/* Scott Kellum Technique - Reference: http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/ */
Use this for SEO/Accessability Friendly
function copy(o) {
var copy = Object.create(Object.getPrototypeOf(o));
var propNames = Object.getOwnPropertyNames(o);
propNames.forEach(function(name) {
var desc = Object.getOwnPropertyDescriptor(o, name);
Object.defineProperty(copy, name, desc);
});
return copy;
for ( name in object ) {
if ( object.hasOwnProperty(name) ) {
// do something
}
}
/* Reference: http://www.jslint.com/lint.html#forin */
@bhongy
bhongy / Git: .gitignore_global
Last active January 4, 2016 03:59
Global Gitignore
# Concept: only source codes that are specific to the project should be tracked
# Temporary/Auxiliary Files
.DS_Store
.project
*.sublime-project
*.sublime-workspace
.sass-cache
fire_app_log.txt
sitemap.xml
@bhongy
bhongy / Wordpress: Do if the_content is not empty
Last active September 15, 2023 03:36
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php if ( get_the_content() ) { ?>
// do or output something
<?php } ?> // break php tag for HTML block
@bhongy
bhongy / CSS: Responsive Video
Last active December 24, 2015 06:39
Responsive Embedded, iFrame Video By TJK Design (http://www.tjkdesign.com)
.video {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.video iframe,
.video object,
.video embed {