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 / Command to merge branch
Created September 25, 2021 12:58
Command to merge branch in Git version control
$ git checkout feature_a
$ git merge master
@makzan
makzan / Code snippet to create new branch
Created September 25, 2021 12:56
Code snippet to create new branch In Git Version Control
git switch -c new_feature
@makzan
makzan / gist:b39259819afd782019db6b8ef9888225
Created September 25, 2021 12:50
Example of adding an empty folder to git version control
$ mkdir images
$ touch images/.gitkeep
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
images/
commit b0d3c42d003152d1195a299ee5a11bb7b82c07d4 (HEAD -> development)
Author: Thomas Seng Hin Mak <[email protected]>
Date: Wed Mar 10 20:55:54 2021 +0800
Example commit.
@makzan
makzan / flexbox-layout.css
Created April 30, 2021 08:33
Flexbox-based mobile-first CSS layout
*{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 October 30, 2020 08:38
mobile-web-2020-test-suite
{
"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 April 9, 2019 05:13
Demo on uploading image to PHP from Alamofire
//
// ViewController.swift
// Upload Image Example
//
import UIKit
import Alamofire
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
import Foundation
class Student {
var enrolledAt:Date = Date()
init(enrolledAt:String) {
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = .withFullDate
self.enrolledAt = dateFormatter.date(from: enrolledAt)!
}
{
"coord": {
"lon": 113.546112,
"lat": 22.20056
},
"sys": {
"country": "MO",
"sunrise": 1383690767,
"sunset": 1383731168
},
@makzan
makzan / wifi-password.php
Created September 1, 2018 07:49
Example code for PHP class
<?php
// DATA
$passwords = [
"John" => "1357",
"Susan" => "2468",
"Steven" => "1890",
"Steve" => "9876"
];