Skip to content

Instantly share code, notes, and snippets.

View ryanamaral's full-sized avatar

Ryan Amaral ryanamaral

View GitHub Profile
@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 / 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

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@ryanamaral
ryanamaral / gh-pages-deploy.md
Created June 12, 2021 08:46 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).