Skip to content

Instantly share code, notes, and snippets.

View aasumitro's full-sized avatar
🌏

A. A. Sumitro aasumitro

🌏
View GitHub Profile
@aasumitro
aasumitro / SplashScreen.java
Last active October 11, 2017 03:50
Splash Screen with Firebase Auth
public class SplashScreen extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 3000;
private FirebaseAuth mAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new Handler().postDelayed(new Runnable() {
<?php
//Unicode trick
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
@aasumitro
aasumitro / privacy_police.css
Last active November 8, 2017 17:51
for privacy police terms condition
/*!
* Start Bootstrap - Clean Blog v3.3.7+1 (http://startbootstrap.com/template-overviews/clean-blog)
* Copyright 2013-2016 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
*/a,body{color:#333}.navbar-custom .nav li a,.navbar-custom .navbar-brand,h1,h2,h3,h4,h5,h6{font-weight:800}.caption,.intro-header .page-heading,.intro-header .site-heading,footer .copyright{text-align:center}body{font-family:Lora,'Times New Roman',serif;font-size:20px;-webkit-tap-highlight-color:#0085A1}.intro-header .page-heading .subheading,.intro-header .post-heading .subheading,.intro-header .site-heading .subheading,.navbar-custom,h1,h2,h3,h4,h5,h6{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif}p{line-height:1.5;margin:30px 0}p a{text-decoration:underline}a:focus,a:hover{color:#0085A1}a img:focus,a img:hover{cursor:zoom-in}blockquote{color:#777;font-style:italic}hr.small{max-width:100px;margin:15px auto;border-width:4px;border-color:#fff}.navbar-c
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-si
@aasumitro
aasumitro / Dicoba.java
Created December 2, 2017 08:50
Java Program
//Contoh komentar pendek
/*
contoh komentar panjang biasa
*/
/**
* contoh komentar panjang untuk dokumentasi
* Nama : nama saya
**/
@aasumitro
aasumitro / Utils.kt
Created December 30, 2017 01:52
Validation utils
package id.asmith.someappclean.utils
import android.content.Context
import android.net.ConnectivityManager
import java.util.regex.Matcher
import java.util.regex.Pattern
/**
* Created by Agus Adhi Sumitro on 23/12/2017.
@aasumitro
aasumitro / Patern.kt
Created December 30, 2017 01:52
email, phone and username pattern
//validation
val EMAIL_PATTERN = ("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")
val USERNAME_PATTERN = ("^[a-z0-9_-]{3,15}\$")
val PHONE_PATTERN = ("^[+(00)][0-9]{6,14}$")
@aasumitro
aasumitro / thread.kt
Created December 31, 2017 06:11
Thread
//Do thread
val background = object : Thread() {
override fun run() {
try {
// Thread will sleep for 2 seconds
sleep((2 * 1000).toLong())
openMainActivity()
finish()
//ini taru di main_activity.xml
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="68dp"
tools:context="id.my.asmith.ktg001.ContentActivity.DetailActivity" />
@aasumitro
aasumitro / SplashWithRx.kt
Created January 25, 2018 01:47
Splash Screen With ReactiveX
fun startTask() {
Observable.interval(3, TimeUnit.SECONDS)
.take(1)
.observeOn(AndroidSchedulers.mainThread())
.observeOn(Schedulers.newThread())
.subscribe { onNextActivity() }
}