Skip to content

Instantly share code, notes, and snippets.

View makzan's full-sized avatar
🎯
Focusing

Thomas Seng Hin Mak makzan

🎯
Focusing
View GitHub Profile
@makzan
makzan / first-letter-inline-block.css
Last active January 12, 2016 15:08
First letter and inline-block
.latest-post-title-inline {
display: inline-block;
}
.latest-post-title-inline:first-letter {
text-transform: lowercase;
}
@makzan
makzan / long-word.css
Created January 13, 2016 12:23
Dealing with long word in CSS (Credit CSS-Tricks)
.hyphenate
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@makzan
makzan / tap-hightlight.css
Created January 14, 2016 12:43
Mobile Safari tap hightlight
.target-element {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
@makzan
makzan / empty-touch-start.js
Created January 14, 2016 12:51
Empty Touch Start to active :active and touch CSS
document.addEventListener("touchstart", function(){}, true);
@makzan
makzan / origami-demo.js
Created February 4, 2016 06:42
origami-demo.js
origami('#demo-1')
.flip('horizontal')
.image('images/person.jpg', 0, 0, 200, 200)
@makzan
makzan / jquery-in-function.js
Created February 16, 2016 03:48
jquery-in-function.js
(function($){
console.log('$ sign is referenced to jQuery: ', $);
$('#test-element').fadeOut().fadeIn();
})(jQuery);
@makzan
makzan / question.php
Created September 8, 2017 02:46
Sample PHP code
<?php
$is_correct = false;
$answer = "";
if (isset($_POST['answer'])) {
$answer = $_POST['answer'];
if ($answer == 150) {
$is_correct = true;
}
}
@makzan
makzan / hello-day.php
Created September 8, 2017 06:46
Basic PHP example on getting today's day
<?php
$name = "Thomas";
$day = date( "l");
?>
<!DOCTYPE html>
<title>Hello PHP</title>
<h1>Hello <?= $name ?></h1>
<p>
It's <?= $day ?> today.
@makzan
makzan / hello-day-20170909.php
Created September 9, 2017 02:32
Sample PHP code for PCMS class
<?php
$name = "PCMS PHP Class";
$day = date("l");
?>
<h1><?= $name ?></h1>
<p>
Welcome to the <?php echo $name ?>.
It is <?= $day ?> today.
</p>