Skip to content

Instantly share code, notes, and snippets.

View ryanamaral's full-sized avatar

Ryan Amaral ryanamaral

View GitHub Profile
@ryanamaral
ryanamaral / bootsel-long-press.ino
Created February 21, 2024 03:38
BOOTSEL Button Long Press Detection (Raspberry Pi Pico RP2040)
/*
* BOOTSEL Button Long Press Detection
*
* This Arduino sketch is based on the bootsel.ino example for the Raspberry Pi Pico RP2040.
* It detects both short and long presses on the BOOTSEL button and counts the number of each type of press.
*
* Hardware:
* - Raspberry Pi Pico RP2040
*
* Software Requirements:
@ryanamaral
ryanamaral / MainActivity.kt
Created December 26, 2022 10:14 — forked from tkuenneth/MainActivity.kt
How to display an adaptive icon in Jetpack Compose
package com.thomaskuenneth.sandbox
import android.graphics.Bitmap
import android.graphics.Canvas
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
@ryanamaral
ryanamaral / EmojiClockExtension.kt
Created December 5, 2022 12:58
🕟 Get Emoji Clock Face given LocalTime (Kotlin)
fun LocalTime.emojiClock(): String {
return if (minute in 15..44) {
// half-hour clock emoji
when (hour % 12) {
0 -> "\uD83D\uDD67" // 🕧
1 -> "\uD83D\uDD5C" // 🕜
2 -> "\uD83D\uDD5D" // 🕝
3 -> "\uD83D\uDD5E" // 🕞
4 -> "\uD83D\uDD5F" // 🕟
5 -> "\uD83D\uDD60" // 🕠
@ryanamaral
ryanamaral / StopwatchAnimation.kt
Created July 22, 2022 18:01 — forked from stevdza-san/StopwatchAnimation.kt
Create a Stopwatch Animation on a Text with Jetpack Compose
import androidx.compose.animation.*
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
@ryanamaral
ryanamaral / gist:02719fe4443115658074247538ff9b7a
Created April 22, 2022 15:13 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
class LocationActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Listen to one flow in a lifecycle-aware manner using flowWithLifecycle
lifecycleScope.launch {
locationProvider.locationFlow()
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
.collect {
// New location! Update the map
@ryanamaral
ryanamaral / MacOS Homebrew Install Java.md
Created December 9, 2021 01:58 — forked from productinfo/MacOS Homebrew Install Java.md
How to install different Java Versions with Homebrew on MacOS

We will install OpenJDK for anything Java 8 and later. Anything prior is probably Oracle JDK.

Prerequisite: Install Homebrew.

Remember to update your formulas.

$ brew update

Latest OpenJDK Feature Release (Java 12, 13, 14, etc...)

<meta content="{{ site.title }}" property="og:site_name">
{% if page.title %}
<meta content="{{ page.title }}" property="og:title">
{% else %}
<meta content="{{ site.title }}" property="og:title">
{% endif %}
{% if page.title %}
<meta content="article" property="og:type">
{% else %}
<meta content="website" property="og:type">

Boolean algebra is one of the foundations of computer science.

There is an unusual property of the boolean XOR operation that I doubt many, or anyone at all, has considered:

If you take any three sets of characters of any equal length - let's label them A, B and C - and then:

XOR A to B Then XOR the result of B to C Then similarly XOR C to A

1. Download latest apktool version.
2. Download the batch file and aapt.exe.
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
4. Open command prompt.
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
6. Now, you need to install the file using the " IF " command.
7. Type the following command.
apktool if name-of-the-app.apk