Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ArnyminerZ's full-sized avatar
🏠
Working from home

Arnau Mora ArnyminerZ

🏠
Working from home
View GitHub Profile
@ArnyminerZ
ArnyminerZ / MapLifecycle.kt
Created April 1, 2022 11:35
osmdroid approach with Jetpack Compose.
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import org.osmdroid.views.MapView
@Composable
@ArnyminerZ
ArnyminerZ / README.md
Created December 21, 2023 15:34
Tarea 3 de DST

Hay que instalar una cosa:

python3 -m pip install py3-validate-email

Y ya puedes ejecutar el script:

python3 tarea3.py
@ArnyminerZ
ArnyminerZ / DatePicker.kt
Last active October 12, 2023 10:19
Date picker for Jetpack Compose - Material Design 3
import android.text.format.DateFormat
import android.view.ContextThemeWrapper
import android.widget.CalendarView
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
@ArnyminerZ
ArnyminerZ / Example.kt
Last active February 3, 2023 06:10
Kotlin extension functions for allowing Parcelable write and read from Android's shared preferences.
// Being Location a Parcelable class, and location a valid initialized instance of this class:
// For writing
sharedPreferences.edit {
putParcelable("location", location)
}
// For reading
val loadedLocation = sharedPreferences.getParcelable<Location?>("location", null)
@ArnyminerZ
ArnyminerZ / Utils.kt
Created April 1, 2022 11:40
Some utility functions for osmdroid. Helps on using the library.
import org.osmdroid.util.BoundingBox
import org.osmdroid.util.GeoPoint
/**
* Computes the center point of all the ones in the list.
* @author Arnau Mora
* @since 20220302
* @return The center point between all the ones in the list.
*/
fun List<GeoPoint>.computeCentroid(): GeoPoint {
@ArnyminerZ
ArnyminerZ / README.md
Last active November 27, 2022 20:11
wkhtmltopdf
@ArnyminerZ
ArnyminerZ / Button.kt
Last active August 24, 2022 14:55
An implementation with Material 3 of a long clickable button.
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.defaultMinSize
@ArnyminerZ
ArnyminerZ / Usage.md
Last active May 30, 2022 10:35
Gives statistics on marks from Intranet of UPV.
  1. For using access the Intranet page where the table of marks is located at.

  2. Right click the table, and select "Inspect element".

  3. Find the table where all the marks are located at, for example: image

  4. Copy the ID of the table, for example t5711998.

  5. Copy and paste the script on the console of your browser, and replace <id> by the id you found before.

  6. Press enter, and the stats will be displayed.

@ArnyminerZ
ArnyminerZ / README.md
Created May 27, 2022 10:19
QuMagie Reverse proxy

The system is running Nginx Proxy Manager, but the file must be edited manually at /data/nginx/proxy_host. Note that this reverse proxy is made to be working with a subdomain, in this case qumagie.***.com.

@ArnyminerZ
ArnyminerZ / qumagie.md
Last active May 17, 2022 19:37
A gist that expands Nginx Proxy Manager to redirect a custom subdomain to a QuMagie instance, without giving public access to QTS. File in markdown for syntax highlighting.

qumagie.conf:

# ------------------------------------------------------------
# qumagie.mydomain.com
# ------------------------------------------------------------


server {
  set $forward_scheme http;
  set $server         "192.168.1.20";