Skip to content

Instantly share code, notes, and snippets.

View IMB11's full-sized avatar

Calum H. IMB11

  • UK, Cumbria
View GitHub Profile
@dev-hydrogen
dev-hydrogen / Easing.java
Last active February 5, 2026 19:28
Various Easings in java
import java.util.function.Function;
import static java.lang.Math.*;
// https://easings.net/
// https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843
public enum Easing {
easeInSine(x -> 1 - cos(x * PI) / 2),
easeOutSine(x -> sin(x * PI) / 2),
easeInOutSine(x -> -(cos(PI * x) - 1) / 2),
@granoeste
granoeste / gist:1026660
Created June 15, 2011 07:48
[Android][Bluetooth]Bluetooth Discovery
// Create a BroadcastReceiver for ACTION_FOUND and ACTION_DISCOVERY_FINISHED
private final BroadcastReceiver mDeviceDiscoverReceiver = new BroadcastReceiver() {
int cnt = 0;
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// When discovery finds a device
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// Get the BluetoothDevice object from the Intent
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);