Skip to content

Instantly share code, notes, and snippets.

View omayib's full-sized avatar
Focusing

omayib omayib

Focusing
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / LookingPersonInsideList.java
Last active August 1, 2017 07:37
how to identify an object by specific attribute
/**
* Created by omayib on 01/08/17.
*/
public class YourApps {
public static void main(String[] args) {
Person arif = new Person("Arif", 20, 163);
Person akbarul = new Person("Akbarul", 25, 160);
Person huda = new Person("Huda", 21, 165);
//insert the data into customers list.
@omayib
omayib / SimpleRepositoryPatternIn.swift
Created August 29, 2017 07:53
Introducing repository pattern with swift.
//: Playground - noun: a place where people can play
import UIKit
class Todo{
var tempId: UUID?
var id : Int
var title: String
var isCompleted: Bool