Skip to content

Instantly share code, notes, and snippets.

View omayib's full-sized avatar
Focusing

omayib omayib

Focusing
View GitHub Profile
class ProfileActivity: GaragePresenter.Contract.View {
lateinit var garagePresenter : GaragePresenter;
fun onCreate(){
garagePresenter = GaragePresenter(this)
garagePresenter.loadTheCars() // we just only need this function on this page
}
override fun onDeleteSucceed() {
// tidak dipakai,dirty code, sia-sia!
@omayib
omayib / simple-logic-test
Last active November 16, 2023 09:31
simple-logic
===== soal 1: 20 menit =============
Buatlah sebuah program yang mencetak angka dari 1 sampai dengan 100,
yang mana, bila angka merupakan kelipatan tiga akan mencetak kata “Fizz” (tanpa tanda petik dua),
lalu bila angka merupakan kelipatan lima akan mencetak “Buzz”,
dan jika angka merupakan kelipatan tiga dan lima kedua-duanya, maka akan mencetak “FizzBuzz”.
contoh output:
1
2
Fizz
<Window x:Class="bookstore.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:bookstore"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<DataTemplate x:Key="DataTemplateItemBook">
fun main(args:Array<String>){
var view1 = ViewPage1()
view1.main()
var view2 = ViewPage2()
view2.main()
var view3 = ViewPage3()
view3.main()
}
<Window
//....
Title="MainWindow" Height="452.55" Width="737.535">
<Grid>
<Image HorizontalAlignment="Left" Height="100" Margin="45,105,0,0" VerticalAlignment="Top" Width="100" Source="assets/anggur.jpg" Stretch="Fill"/>
<Image HorizontalAlignment="Left" Height="100" Margin="176,105,0,0" VerticalAlignment="Top" Width="100" Source="assets/apple.png" Stretch="Fill"/>
<Image HorizontalAlignment="Left" Height="100" Margin="45,255,0,0" VerticalAlignment="Top" Width="100" Source="assets/banana.jpg"/>
<Image HorizontalAlignment="Left" Height="100" Margin="176,255,0,0" VerticalAlignment="Top" Width="100" Source="assets/orange.png"/>
<Button x:Name="Button1" Content="Add" HorizontalAlignment="Left" Margin="57,217,0,0" VerticalAlignment="Top" Width="75" Click="Button1_Click"/>
<Button x:Name="Button2" Content="Add" HorizontalAlignment="Left" Margin="187,216,0,0" VerticalAlignment="Top" Width="75" Click="Button2_Click"/>
@omayib
omayib / TheCashier.MainWindow.xaml
Last active September 24, 2019 14:05
tampilan untuk aplikasi the cashier
<Window x:Class="TheCompany.MainWindow"
Title="MainWindow" Height="710" Width="470">
<Grid Margin="0,0,2,-3">
<ListBox x:Name="listBox" HorizontalAlignment="Left" Height="217" Margin="58,328,0,0" VerticalAlignment="Top" Width="344">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="75" />
@omayib
omayib / TheGunShoots.cs
Created July 8, 2019 14:42
the fundamental of abstract class. When are you use abstract class or use interface.
TheGunListener theGunListener = new TheGunListener();
//shotGun is take out one projectiles per shoot
Gun shotGun = new ShotGun("S12K", "Brown");
shotGun.addProjectile(3);
shotGun.setOnShootListener(theGunListener);
//Deagle is take out two projectiles in one shoot
Gun deagle = new Deagle("Deagle", "Red");
deagle.addProjectile(3);
deagle.setOnShootListener(theGunListener);
class PrivacyPolicy : AppCompatActivity() {
val privacyPolicyUrl = "http://hepicar.com/privacy_policy.html"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_privacy_policy)
title = "Privacy Policy"
val webViewClient = object :WebViewClient(){
function myFunction() {
String.prototype.format = function() {
a = this;
for (k in arguments) {
a = a.replace("{" + k + "}", arguments[k])
}
return a
};
var weekday = new Array(7);
weekday[0] = "Minggu";
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
publishing {
publications {
library(MavenPublication) {
// Don't forget to change these
groupId 'com.hepicar'
artifactId 'sdk'
version '0.0.1'