Skip to content

Instantly share code, notes, and snippets.

View omayib's full-sized avatar
Focusing

omayib omayib

Focusing
View GitHub Profile
@omayib
omayib / gist:193a608f4f84323f74c3e91a6c5ab813
Created October 4, 2024 01:06
pip list for beatcraft
Package Version
------------------------ ------------
aiofiles 23.2.1
annotated-types 0.7.0
antlr4-python3-runtime 4.9.3
anyio 4.6.0
audiocraft 1.3.0
audioread 3.0.1
av 11.0.0
blis 0.7.11
//1st : ambil data array list mahasiswa, untuk dilihat list DataID
var list = []
//2nd : buat function iterasi, untuk meng-update setiap DataID
function mark(){
for( let i=0;i<list.length;i++){
console.log(list[i].DataId);
fetch("https://dosen.amikom.ac.id/api/ujian/mark_checked", {
"headers": {
"accept": "application/json, text/plain, */*",
@omayib
omayib / codejam.cs
Created June 28, 2021 01:32
a code jam
namespace CodeChellange1
{
class Animal
{
public void walk()
{
Console.WriteLine("i am walking");
}
}
@omayib
omayib / DeisgnPatternByExample.kt
Last active May 21, 2020 00:09
Sharing ngabuburit Ramadhan 2020 bersama Yogya Android Community dan Android Amikom Developer.
// JUMP TO LINE CODE 214 TO SEE THE MAIN APPS
//=============== CASE 1 ===============
data class Nasabah(var name:String, var alamatTinggal:String,
var alamatKtp:String, var tglLahir:String, var tempatLahir:String,
var umur:String, var jmlAnak:String, var statusNikah:String="menikah",
var statusRumah:String, var nmrKtp:String, var namaIbuKandung:String,
var namaAliasIbuKandung:String, var namaPasangan:String="", var statusPasangan:String="menikah")
//=====================================
/* how to use
=== without builder pattern ===
Personal nasabah = new Personal("joko","sleman","","06/04/80",
"Tempel","40","4","menikah",
"kontrak","3314140604800045","maryani",
"yanik","sri","menikah","laki-laki","08763543","swasta")
==== with builder pattern ===
Personal nasabah = new Personal.Builder().addressByCurrent(addrCurrent)
class ProfileActivity: GaragePresenter.Contract.OnLoadCarSucceed {
lateinit var garagePresenter : GaragePresenter;
fun onCreate(){
garagePresenter = GaragePresenter()
garagePresenter.setOnLoadCarSucceedListener(this)
garagePresenter.loadTheCars() // we just only need this function on this page
}
override fun onLoadSucceed() {
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()
}