Skip to content

Instantly share code, notes, and snippets.

View hidrodixtion's full-sized avatar

Adi Nugroho hidrodixtion

View GitHub Profile
@hidrodixtion
hidrodixtion / cc_clustering.R
Created May 1, 2021 05:48
Credit Card Clustering
# install.packages("skimr")
# install.packages("tidyverse")
library("data.table")
library(skimr)
library(tidyverse)
library(cluster)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
@hidrodixtion
hidrodixtion / usa_flight_analysis.r
Created March 20, 2021 06:36
USA Flight Analysis
### Please uncomment the install.packages below
### for installing the required libraries
# install.packages("rstudioapi")
# install.packages("data.table")
library("data.table")
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
cat(getwd())
@hidrodixtion
hidrodixtion / keybase.md
Created October 21, 2019 07:00
keybase.md

Keybase proof

I hereby claim:

  • I am hidrodixtion on github.
  • I am adinugroho (https://keybase.io/adinugroho) on keybase.
  • I have a public key ASAgVxZvWSPZZHqXG2x83LezNRR9W15aGNVe1mhCIpTxoAo

To claim this, I am signing this object:

package com.studio.suku.submission3;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
import android.util.Log;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
@hidrodixtion
hidrodixtion / script.gs
Created February 17, 2019 10:05
localizable-sheet-script
/*
localizable-sheet-script
A Google Sheets script that will take a sheet in a specific format and return iOS and Android localization files.
https://github.com/cobeisfresh/localizable-sheet-script
Created by COBE http://cobeisfresh.com/ Copyright 2017 COBE
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRI
@hidrodixtion
hidrodixtion / 01. README.md
Last active December 21, 2018 01:49
Localization Helper

How to:

  1. Install tty gem gem install tty
  2. Run the script ruby LocHelper.rb
@hidrodixtion
hidrodixtion / 01-Notes on UI Test
Last active October 8, 2018 13:38
Instrumentation Test Example
- Instrumentation Test = UI Test
- Artinya testing UI di app. Contoh = test apakah ada text "Arsenal" di page detail, ketika item no 2 di recyclerview mainactivity diklik
- Pastikan teman-teman mengikuti & membaca dependencies yg diperlukan di modul Testing di Dicoding
- Untuk thread.sleep jika teman-teman menggunakan emulator mungkin butuh delay yg lebih lama dan silahkan diubah manual jika masih terdapat error di eksekusi setelah sleep
@hidrodixtion
hidrodixtion / 01-Notes on unit test
Last active October 8, 2018 13:26
Unit Test Examples
- Unit test dijalankan di JVM di dalam komputer, jadi Runnernya (JUnit) tidak mengetahui tentang framework android.
- Jangan melakukan testing di class yang bergantung ke android framework (activity, fragment, Uri, recyclerview, adapter, dll)
- Jika teman-teman menggunakan Uri Builder, ubah menjadi string seperti contoh di bawah.
- Jika ketika teman-teman testing request tapi mendapat error LOOPER, silahkan dibaca di modul Unit Testing bagian Mockito.
@hidrodixtion
hidrodixtion / NotificationService.swift
Last active August 16, 2018 02:30
NotificationService code
import UserNotifications
import OneSignal
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var receivedRequest: UNNotificationRequest!
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
@hidrodixtion
hidrodixtion / determine_event.rb
Created November 1, 2017 03:03
Determine the type of line event
when Line::Bot::Event::Message
case event.type
when Line::Bot::Event::MessageType::Text
message = {
type: 'text',
text: event.message['text']
}
client.reply_message(event['replyToken'], message)
when Line::Bot::Event::MessageType::Image, Line::Bot::Event::MessageType::Video
response = client.get_message_content(event.message['id'])