Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Thomas Seng Hin Mak makzan

🎯
Focusing
View GitHub Profile
@makzan
makzan / Code snippet to create new branch
Created Sep 25, 2021
Code snippet to create new branch In Git Version Control
@makzan
makzan / gist:b39259819afd782019db6b8ef9888225
Created Sep 25, 2021
Example of adding an empty folder to git version control
View gist:b39259819afd782019db6b8ef9888225
$ mkdir images
$ touch images/.gitkeep
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
images/
View Example git commit
commit b0d3c42d003152d1195a299ee5a11bb7b82c07d4 (HEAD -> development)
Author: Thomas Seng Hin Mak <mak@makzan.net>
Date: Wed Mar 10 20:55:54 2021 +0800
Example commit.
@makzan
makzan / flexbox-layout.css
Created Apr 30, 2021
Flexbox-based mobile-first CSS layout
View flexbox-layout.css
*{box-sizing: border-box;}
img {max-width: 100%;}
.row {
display: flex;
flex-wrap: wrap;
}
.row .row {
margin-left: -.5em;
margin-right: -.5em;
}
@makzan
makzan / package.json
Created Oct 30, 2020
mobile-web-2020-test-suite
View package.json
{
"name": "mobile-web-2020-test-suite",
"version": "1.0.0",
"description": "Automated test cases for mobile web technologies competition 2020",
"devDependencies": {
"axe-core": "^4.0.2",
"cy-mobile-commands": "^0.2.1",
"cypress": "^5.0",
"cypress-axe": "0.8.1",
"cypress-commands": "^1.1.0",
@makzan
makzan / ViewController.swift
Created Apr 9, 2019
Demo on uploading image to PHP from Alamofire
View ViewController.swift
//
// ViewController.swift
// Upload Image Example
//
import UIKit
import Alamofire
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
View Sorted_by.swift
import Foundation
class Student {
var enrolledAt:Date = Date()
init(enrolledAt:String) {
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = .withFullDate
self.enrolledAt = dateFormatter.date(from: enrolledAt)!
}
View example-openweather-output.json
{
"coord": {
"lon": 113.546112,
"lat": 22.20056
},
"sys": {
"country": "MO",
"sunrise": 1383690767,
"sunset": 1383731168
},
@makzan
makzan / wifi-password.php
Created Sep 1, 2018
Example code for PHP class
View wifi-password.php
<?php
// DATA
$passwords = [
"John" => "1357",
"Susan" => "2468",
"Steven" => "1890",
"Steve" => "9876"
];
@makzan
makzan / simple-questions.php
Created Sep 1, 2018
Example code for PHP class
View simple-questions.php
<?php
// DATA
$questions=[];
$questions[] = [
"q" => "1+2",
"ans" => "3"
];
$questions[] = [
"q" => "3x5",
"ans" => "15"