Skip to content

Instantly share code, notes, and snippets.

View omayib's full-sized avatar
Focusing

omayib omayib

Focusing
View GitHub Profile
@omayib
omayib / AndroidManifest.xml
Created November 24, 2012 03:01
Pengenalan GPS
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gps.sederhana"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
</uses-permission>
@omayib
omayib / AndroidManifest.xml
Created November 24, 2012 03:05
menampilkan map
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<application
@omayib
omayib / AndroidManifest.xml
Created November 24, 2012 03:07
Menampilkan overlay diatas map
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.map.marker"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
@omayib
omayib / BalokRenderer.java
Created December 9, 2012 23:24
activity to show a geometry
package com.lostmind.kreatip.baru;
import javax.microedition.khronos.opengles.GL10;
import rajawali.BaseObject3D;
import rajawali.animation.Animation3D;
import rajawali.animation.RotateAnimation3D;
import rajawali.lights.DirectionalLight;
import rajawali.materials.SimpleMaterial;
import rajawali.math.Matrix4;
@omayib
omayib / install scala 2.11.2
Created October 16, 2014 03:13
how to install scala 2.11.2 version
#Problem error
error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
#requierement
- i install scala 2.9.1 version (via console sudo apt-get install scala)
and java 8 version on my Ubuntu 12.04.
#suspect
- scala 2.9.1 version which is not yet support for java 8
@omayib
omayib / LoginVC.swift
Last active December 12, 2016 22:35
spaghetti code loading view was spread in almost view controller.
import SJProgressHUD
//import anything
//we also put SJProgressHUD in almost ViewController which need to render loading view.
class LoginVC: UIViewController {
func viewDidLoad(){
//other code here...
}
func buttonTapped(){
//other logic here...
SJProgressHUD.show(...)
@omayib
omayib / UIViewControllerExtension.swift
Created December 12, 2016 22:07
an extension from UIViewController
import SJProgressHUD
class UIViewControllerExtension {
extension UIViewController {
func showWaiting(message: String){
SJProgressHUD.showWaiting(message)
}
func showError(message: String){
SJProgressHUD.showError(message)
}
@omayib
omayib / LoginVC.swift
Created December 12, 2016 22:12
after the UIViewController is inherited into UIViewControllerExtension class, we can call all new function from any UIViewController
//no need to import SJProgressHUD
class LoginVC:UIViewController{
func viewDidLoad(){
}
func buttonTapped(){
//magic here... wa can call it any where on each UIViewController
showWaiting("please wait...")
}
}
@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!")
}
@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()
}