Skip to content

Instantly share code, notes, and snippets.

View thuytrinh's full-sized avatar
💭
${null}

Thuý thuytrinh

💭
${null}
  • Frankfurt, Germany
  • 05:37 (UTC +02:00)
View GitHub Profile
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@rossharper
rossharper / ParameterizedKotlinTest.kt
Created February 20, 2016 21:51
Parameterized JUnit4 test example in Kotlin
@RunWith(Parameterized::class)
class KotlinTest(val paramOne: Int, val paramTwo: String) {
companion object {
@JvmStatic
@Parameterized.Parameters
fun data() : Collection<Array<Any>> {
return listOf(
arrayOf(1, "I"), // First test: (paramOne = 1, paramTwo = "I")
arrayOf(1999, "MCMXCIX") // Second test: (paramOne = 1999, paramTwo = "MCMXCIX")
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@chrisdone
chrisdone / typing.md
Last active March 22, 2024 23:24
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@stkent
stkent / android-bluetooth-low-energy-resources.md
Last active February 8, 2024 16:22
Android Bluetooth Low Energy (BLE) Resources
public class AnimatedActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//opening transition animations
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale);
}
@srivastavarobin
srivastavarobin / AndroidJavaCodeReview.md
Last active August 4, 2023 10:32
Code Review Checklist for Android (Java Only)

My Android Java Code Review Checklist

  1. Is the functionality correct?
  2. Are the classes named suitably?
  3. Are the functions named suitably?
  4. How's the datastructure being used? Is it the correct DS or it needs improvement?
  5. Can the classes be further borken into small classes?
  6. Do we need an interface?
  7. If it contain functions that can be reused later then are there Utils created for them?
  8. Can it use already available Util functions?
  9. Does the large set of input for a function deserve a new bean to be created?
@pocmo
pocmo / ViewPagerAdapter.java
Created October 21, 2012 15:02
ViewPagerAdapter: Implementation of PagerAdapter that represents each page as a View
/*
* Copyright (C) 2012 Sebastian Kaspari
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@craigzour
craigzour / PairingManager.kt
Created May 10, 2018 13:54
Here is a way of implementing pairing/bonding with RxAndroidBle
package hello.world
import android.bluetooth.BluetoothDevice
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.BroadcastReceiver
import com.polidea.rxandroidble2.RxBleDevice
import io.reactivex.Completable
import io.reactivex.disposables.Disposables