Skip to content

Instantly share code, notes, and snippets.

View foliolo's full-sized avatar
💭
Coding!

Alberto foliolo

💭
Coding!
  • Edinburgh
View GitHub Profile
@foliolo
foliolo / Event.kt
Created April 26, 2023 10:58 — forked from JoseAlcerreca/Event.kt
An event wrapper for data that is exposed via a LiveData that represents an event.
/**
* Used as a wrapper for data that is exposed via a LiveData that represents an event.
*/
open class Event<out T>(private val content: T) {
var hasBeenHandled = false
private set // Allow external read but not write
/**
* Returns the content and prevents its use again.
@foliolo
foliolo / AdbCommands
Created February 27, 2023 08:43 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@foliolo
foliolo / PermissionHelper.java
Created September 14, 2022 19:35
PermissionHelper to be used in services
/*
* Copyright © 20132016 Michael von Glasow.
*
* This file is part of LSRN Tools.
*
* LSRN Tools is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@foliolo
foliolo / Program.cs
Created February 22, 2017 17:18
C# & py => Lectura de fichero para Google (Hash Code)
namespace PizzaTest
{
class Program
{
// Variables
private static long R; //Rows
private static long C; //Columns
private static long L; //Min num of each ingredient in a slice
private static long H; //Max num of cell in a slice
private static Char[][] pizza; // Matriz bidimensional de la pizza