Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Arnau Mora ArnyminerZ

🏠
Working from home
View GitHub Profile
@ArnyminerZ
ArnyminerZ / qumagie.md
Last active May 17, 2022
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.
View qumagie.md

qumagie.conf:

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


server {
  set $forward_scheme http;
 set $server "192.168.1.20";
@ArnyminerZ
ArnyminerZ / MapLifecycle.kt
Created Apr 1, 2022
osmdroid approach with Jetpack Compose.
View MapLifecycle.kt
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 / DatePicker.kt
Last active Apr 18, 2022
Date picker for Jetpack Compose - Material Design 3
View DatePicker.kt
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 / Utils.kt
Created Apr 1, 2022
Some utility functions for osmdroid. Helps on using the library.
View Utils.kt
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 / Usage.md
Created Mar 24, 2022
Gives statistics on marks from Intranet of UPV.
View Usage.md
  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.

View Ejercicio5_1.m
a=-2; b=4; % El rango del cuadrado primero
side=20; % El tamaño del lado
h=(-a+b)/side; % Obtenemos el rango
x=a:h:b;
a=-2; b=4; % El rango del cuadrado primero
side=20; % El tamaño del lado
k=(-a+b)/side; % Obtenemos el rango
y=a:h:b;
View Ejercicio4_3.m
% Dibuja el gradiente de la función z = sen x sen y en el rectángulo
% [−2,2]×[−0.4,1] dividiendo el dominio en cuadrados de lado 0.2. ¿Se
% observa algún punto crítico? ¿De qué tipo?
a = -6; b = 6; % Intervalo
m = 10/0.2; % Número de subintervalos
h = 0.2; % (b-a)/m; % Paso
x = a:h:b; % Partición
a = -4; b = 4; % Intervalo
@ArnyminerZ
ArnyminerZ / paraulogic.js
Created Jan 21, 2022
Per a aquells mandrosos que vulguen fardar davant la família. Solució al paraulògic del 21/01/2022
View paraulogic.js
var words = Object.keys(t["p"]);
for(p in words){
document.getElementById('test-word').innerText = words[p];
document.getElementById('submit-button').click();
}
@ArnyminerZ
ArnyminerZ / README.md
Created Oct 3, 2021
Instrucciones para crear un proyecto de Python
View README.md

Para asegurarnos que las dependencias siempre esten en la última versión podemos usar el Dependabot, que se encargará de crear pull requests actualizando a las últimas versiones.

version: 2
updates:
  - package-ecosystem: pip
    directory: "/"
    schedule:
      interval: daily
 labels:
@ArnyminerZ
ArnyminerZ / Example.kt
Last active Jun 5, 2021
Kotlin extension functions for allowing Parcelable write and read from Android's shared preferences.
View Example.kt
// 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)