Skip to content

Instantly share code, notes, and snippets.

Working from home

Arnau Mora ArnyminerZ

Working from home
View GitHub Profile
View gist:b4b6568627311dab7aac73118618d6d3
"activity": {
"name": "Gimcana Fotogràfica IES Pare Vitòria 2018",
"code": "GFIP018",
"questions": {
"1": {
"question": "Què és i no és?",
"location": {
"lat": "10",
"lon": "15"
ArnyminerZ / After Effects Expression.js
Created Jan 26, 2020
Analize your GoPro footage and animate your content
View After Effects Expression.js
function analize(file, yMin, yMax){
eval("var gopro=" + footage(file).sourceText);
// (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
outMax = yMax; // Y max
outMin = yMin; // Y min
inMax = parseFloat(gopro.streams.GPS5.min_alt);
inMin = parseFloat(gopro.streams.GPS5.max_alt);
samplesDuration = parseInt(gopro.streams.GPS5.duration);
samplesCount = gopro.streams.GPS5.samples.length;
ArnyminerZ / Example.kt
Last active Apr 14, 2020
Use MySQL in Android Kotlin Apps
View Example.kt
// MYSQL_USER, MYSQL_PASS and MYSQL_HOST are constants
private fun connect(): MySQLConnector? {
Log.v(TAG, "MySQL Connecting...")
val connector = MySQLConnector()
if (connector.connect(MYSQL_USER, MYSQL_PASS, MYSQL_HOST))
Log.v(TAG, " Connection correct!")
else {
Log.e(TAG, " Connection failed!")
return null
View JSONArrayExtension.kt
fun JSONArray.sort(keyName: String): JSONArray {
val sortedJsonArray = JSONArray()
val jsonValues = arrayListOf<JSONObject>()
for (a in 0 until length())
jsonValues.sortWith { a, b ->
val valA = a.getStringSafe(keyName) ?: a.get(keyName) as String
val valB = b.getStringSafe(keyName) ?: b.get(keyName) as String
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)
ArnyminerZ /
Created Oct 3, 2021
Instrucciones para crear un proyecto de Python

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
  - package-ecosystem: pip
    directory: "/"
      interval: daily
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];
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
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
a=-2; b=4; % El rango del cuadrado primero
side=20; % El tamaño del lado
k=(-a+b)/side; % Obtenemos el rango
ArnyminerZ /
Created Mar 24, 2022
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.