Skip to content

Instantly share code, notes, and snippets.

View ydhnwb's full-sized avatar
🎯
Focusing

Prieyuda Akadita S. ydhnwb

🎯
Focusing
  • 12:05 (UTC +07:00)
View GitHub Profile
import 'package:flutter/material.dart';
import 'dart:convert';
import 'ApiHelper.dart';
import 'UserModel.dart';
void main(){
runApp(new MyApp());
import 'package:http/http.dart' as http;
import 'dart:async';
const baseUrl = "https://jsonplaceholder.typicode.com";
class ApiHelper{
static Future getAllUsers(){
return http.get(baseUrl+"/users");
}
class UserModel {
int id;
String name;
String email;
String website;
UserModel(int id, String name, String email, String website){
this.id = id;
this.name = name;
this.email = email;
@ydhnwb
ydhnwb / index.php
Created September 24, 2018 04:38
Milik simplecrudoop
<head>
<?php
include 'function/databaseHelper.php';
include 'res/layout/header.php';
$db = new DatabaseHelper();
$data = $db->getAllUsers();
?>
<nav class="navbar navbar-expand-lg navbar-dark cyan">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText"
aria-expanded="false" aria-label="Toggle navigation">
@ydhnwb
ydhnwb / header.php
Created September 24, 2018 04:44
milik crudoopphp
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>MDB OOP CRUD - Prieyudha Akadita S</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap core CSS -->
<link href="res/style/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="res/style/css/mdb.min.css" rel="stylesheet">
<head>
<?php
/**
* Created by PhpStorm.
* User: Prieyuda Akadita S
* Date: 23/09/2018
* Time: 12:47
*/
include 'function/databaseHelper.php';
include 'res/layout/header.php';
<?php
/**
* Created by PhpStorm.
* User: Prieyuda Akadita S
* Date: 23/09/2018
* Time: 11:59
*/
return array(
'host' => 'localhost',
'user' => 'root',
@ydhnwb
ydhnwb / Application.kt
Created November 25, 2018 15:19
Simple Ktor REST API
package com.ydhnwb
import com.fasterxml.jackson.databind.SerializationFeature
import com.ydhnwb.services.DatabaseHelper
import com.ydhnwb.services.UserService
import com.ydhnwb.web.widget
import io.ktor.application.*
import io.ktor.features.CallLogging
import io.ktor.features.ContentNegotiation
import io.ktor.features.DefaultHeaders
from sklearn import tree
#datasets
#outlook = 0 is sunny, 1 is overcast, 2 is rainy
#temperature = 0 is hot, 1 is mild, 2 is cool
#humidity = 0 is high, 1 is normal
#isWindy? 0 false : 1 true
#outlook #temperature #humidity #windy
x = [
[0, 0, 0, 0],
private static void loadData(){
Call<WrappedListResponse<Recipe>> data = postService.getPosts("Bearer "+getToken());
data.enqueue(new Callback<WrappedListResponse<Recipe>>() {
@Override
public void onResponse(Call<WrappedListResponse<Recipe>> call, Response<WrappedListResponse<Recipe>> response) {
if(response.isSuccessful()){
WrappedListResponse<Recipe> body = response.body();
if(body.getStatus() == 1){
mList = (ArrayList<Recipe>) body.getData();
recipeAdapter = new RecipeAdapter(mList, context);