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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / createjs-starting-point-with-retinalize.js
Created January 1, 2016 05:05
CreateJS starting point with Retina support
class App {
constructor() {
this.canvas = document.getElementById("app-canvas");
this.stage = new createjs.Stage(this.canvas);
this.retinalize();
createjs.Ticker.setFPS(60);
@makzan
makzan / .gitconfig
Last active December 28, 2015 04:49
Git config for my c9 IDE
[user]
name = Thomas Seng Hin Mak
email = [email protected]
[core]
editor = nano
whitespace = off
excludesfile = ~/.gitignore
[advice]
statusuoption = false
[color]