Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

A. A. Sumitro aasumitro

🎯
Focusing
View GitHub Profile
@aasumitro
aasumitro / SplashScreen.java
Last active Oct 11, 2017
Splash Screen with Firebase Auth
View SplashScreen.java
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() {
View foreign_character.php
<?php
//Unicode trick
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
@aasumitro
aasumitro / privacy_police.css
Last active Nov 8, 2017
for privacy police terms condition
View privacy_police.css
/*!
* 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
View bootstrap.min.css
/*!
* 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
View Dicoba.java
//Contoh komentar pendek
/*
contoh komentar panjang biasa
*/
/**
* contoh komentar panjang untuk dokumentasi
* Nama : nama saya
**/
@aasumitro
aasumitro / Utils.kt
Created Dec 30, 2017
Validation utils
View Utils.kt
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 Dec 30, 2017
email, phone and username pattern
View Patern.kt
//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}$")
View thread.kt
//Do thread
val background = object : Thread() {
override fun run() {
try {
// Thread will sleep for 2 seconds
sleep((2 * 1000).toLong())
openMainActivity()
finish()
View Test.java
//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 Jan 25, 2018
Splash Screen With ReactiveX
View SplashWithRx.kt
fun startTask() {
Observable.interval(3, TimeUnit.SECONDS)
.take(1)
.observeOn(AndroidSchedulers.mainThread())
.observeOn(Schedulers.newThread())
.subscribe { onNextActivity() }
}
You can’t perform that action at this time.