Skip to content

Instantly share code, notes, and snippets.

View mfebrianto's full-sized avatar

michael febrianto mfebrianto

View GitHub Profile
floatingActionButton: FloatingActionButton(onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add))
@mfebrianto
mfebrianto / curl_witcher_chars.sh
Created February 20, 2020 01:38
curl_witcher_chars.sh
curl --request GET 'https://e9a464b0-809c-4c35-be1d-846daa45ed96.mock.pstmn.io/characters'
@mfebrianto
mfebrianto / witcher_characters.json
Last active February 20, 2020 04:22
characters of witchers
{
"data": {
"characters": [
{
"name": "Geralt of Rivia",
"id": "5d5ae34a799ab50008ba95a0"
},
{
"name": "Vesemir",
"id": "5d5aeb47799ab50008ba95a7"
@mfebrianto
mfebrianto / ExampleInstrumentedtest.kt
Created January 29, 2020 23:39
update of ExampleInstrumentedTest
package com.example.mock
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
@mfebrianto
mfebrianto / build.gradle
Created January 29, 2020 23:36
build.gradle of mock
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
package com.example.mock
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import org.hamcrest.core.StringContains
import org.junit.Rule
@mfebrianto
mfebrianto / MainActivity.kt
Last active January 29, 2020 22:25
main activity of mock app
package com.example.mock
import android.os.Bundle
import android.os.StrictMode
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
@mfebrianto
mfebrianto / AndroidManifest.xml
Created January 29, 2020 21:59
gist for android mock using webmock
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mock">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
/opt/redis/redis-stable/src/redis-cli
HDEL schedules key check_instagram_tags_number