Skip to content

Instantly share code, notes, and snippets.

View omayib's full-sized avatar
Focusing

omayib omayib

Focusing
View GitHub Profile
@omayib
omayib / PersonalLibrarySystem.cpp
Created May 21, 2017 07:54
Pemahaman tentang OOP
/*
21 May 2017
created by Arif Akbarul Huda.
PENGANTAR
Pak Amir adalah orang terpandang didesanya yang memiliki hobi membaca.
Dirumahnya tersimpan ratusan koleksi buku.
Supaya bermanfaat, Pak Amir membuat perpustakaan pribadi dan warga sekitar boleh meminjam.
@omayib
omayib / HelloDoctors.swift
Created April 26, 2017 06:04
handling multiple data source in swift
//: Playground - noun: a place where people can play
import UIKit
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
enum Response<T> {
case succeed(T)
case failed(message: String)
@omayib
omayib / dummy data sistme peminjaman
Created March 31, 2017 02:42
dummy data sistme peminjaman
{
"inventaris": [
{
"id": 1,
"nama": "mobil1aaaaaaa",
"jumlah": 3,
"stock_minimum": 2,
"access": [
"Karyawan",
"dosen"
@omayib
omayib / score_player.xml
Created March 30, 2017 03:13
score board for android course challange. user can type the two players name
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/activity_horizontal_margin">
<TextView
android:text="Player 1"
android:layout_marginTop="8dp"
@omayib
omayib / score_board.xml
Created March 30, 2017 03:12
score board for android course challange. user can increase or decrease the score.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent">
@omayib
omayib / StrategyPatterin.swift
Created December 16, 2016 09:06
an implementation of strategy pattern on swift
//: Playground - noun: a place where people can play
import UIKit
//lets to trya strategy pattern!
protocol QCallKit{
func dial()
func endCall()
func accept()
@omayib
omayib / LoginVC.swift
Created December 13, 2016 03:02
Put the UILoadingView adapter into specific class
class LoginVC: UIViewController, UILoadingView{
func anyProcessNeedToShowLoadingView(){
showLoadingWithLabel(subtitle: "please wait...")
}
}
@omayib
omayib / UILoadingView.swift
Created December 13, 2016 03:01
an implementation of UILoadingViewProtocol class
import PKHUD
extension UILoadingView where Self: UIViewController {
func hideLoading(){
HUD.hide()
}
func showLoading(){
HUD.show(.progress)
}
func showLoadingWithLabel(title:String? = "Waiting", subtitle:String){
@omayib
omayib / UILoadingProtocol.swift
Created December 13, 2016 03:00
Start with protocol
protocol UILoadingView {
func showLoading()
func showLoadingWithLabel(title:String?, subtitle:String)
func showErrorWithLabel(message: String)
func showSuccessWithLabel(message:String)
func hideLoading()
}
@omayib
omayib / UILoadingViewController.swift
Last active December 12, 2016 22:34
subclassing the UIViewController into UILoadingVeiwController
class UILoadingViewController: UIViewController{
func showWaiting(message: String){
print("show waiting from UILoadingViewController with message \(message)")
}
}
class LoginVC : UILoadingViewController{
func buttonTapped(){
showWaiting(message: "show me!")
}