Skip to content

Instantly share code, notes, and snippets.

Ayúdame a limpiar de publicidad el móvil Android de un familiar que tengo
enchufado por USB. Es una persona mayor y le cuesta manejarse con anuncios y
apps basura, así que el objetivo es dejarlo simple y sin publicidad.
CONTEXTO Y HERRAMIENTAS
- Estoy en Windows. adb suele NO estar en el PATH: búscalo antes de rendirte,
normalmente está en C:\Users\<USUARIO>\AppData\Local\Android\Sdk\platform-tools\adb.exe
Si no existe, dímelo.
- Empieza con `adb devices`. Si sale vacío, ayúdame a activar la Depuración USB
(Opciones de desarrollador: tocar 7 veces la versión de compilación; en Xiaomi
@dei-biz
dei-biz / index.html
Created March 12, 2025 18:01
Geodesics from any point to its antipode using Miller Cylindrical Projection
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<title>Mapa Mundial con Proyección Miller y Geodésicas</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src= "https://d3js.org/d3-geo-projection.v2.min.js"></script>
<style>
body { margin: 0; overflow: hidden; }
svg { background: #e0f7fa; }
async function getTodosList() {
const response = await fetch('https://jsonplaceholder.typicode.com/todos'); //fetch es await function. Podemos llamarlo con await y esperará aquí
const data = await response.json(); //.json es método async, podemos llamarlo con await y esperará aquí.
return data; //el return lo hará cuando la línea anterior acabe, después de esperar la conversión a json de la response
}
async function countCompletedTodosTitleLength(){
const todos = await getTodosList(); //Llamamos a getTodosList y esperamos aquí hasta que acabe.
console.log(todos
@dei-biz
dei-biz / executeEveryNMinutes.js
Created March 22, 2019 09:48
Execute a function every N minutes at even hour divisions. I.E: 10:00, 10:15, 10:30, 10:45, 11:00 etc
/*receives a function and an integer between 1 and 60. Executes the function every N minutes at even hour divisions*/
const executeEveryNMinutes = (callback, minutes)=>{
if (!(Number.isInteger(minutes) && minutes>0 && minutes<60 && typeof(callback) == "function")){
return false;
}
const now = new Date();
const nextTime = new Date(now.getTime() + minutes * 60 * 1000 + 1);
const nextTimeRound = new Date(nextTime
.setMinutes(minutes*(Math.floor((nextTime.getMinutes() / 60) * (60/minutes)))))
@dei-biz
dei-biz / every15.js
Last active March 22, 2019 09:51
Every15minutes
//Superseded by https://gist.github.com/dei-biz/112c3825b5752c76dcb0a915b49bca47
executeNext15 = (callback)=>{
const now = new Date();
const nextTime = new Date(now.getTime() + 15 * 60 * 1000 + 1);
const nextTimeRound = new Date(nextTime
.setMinutes(15*(Math.floor((nextTime.getMinutes() / 60) * 4)))) //every 15 minutes/4 times an hour
.setSeconds(0)
const timeout = nextTimeRound - now;
@dei-biz
dei-biz / mysql2xslx
Created May 14, 2018 17:19
Python3 XLSX from MySQL
import pandas as pd
host = 'HOST'
port = 3306
user = 'USER'
password = 'PASS'
database = 'DATABASE'
writer = pd.ExcelWriter(database+'.xlsx')
{
"query" : {
"bool" : {
"should" : [{
"multi_match" : {
"type" : "best_fields",
"fields" : ["campo_importante^3", "campo_menos_importante^2", "campo_poco_importante"],
"query" : "QUERY"
}
}, {
@dei-biz
dei-biz / scaleCanvas.js
Last active January 18, 2017 12:21
scale a region of a canvas to the whole canvas given a boundaries object
var scaleCanvas = function(canvas, bb){
var retina = window.devicePixelRatio;
var width = canvas.width;
var height = canvas.height;
var newWidth = bb.xMax - bb.xMin;
var newHeight = bb.yMax - bb.yMin;
var aspectCanvas = width/height;
var aspectBB = newWidth/newHeight;
var offsetX = 0;
var offsetY = 0;
@dei-biz
dei-biz / findbb.js
Created January 15, 2017 00:03
find boundary box of non transparent pixels on a <canvas>
var findBB = function(canvas){
var width = canvas.width;
var height = canvas.height;
var imageData = canvas.getContext('2d').getImageData(0,0,width,height);
var data = imageData.data;
var bounds = {
xMax : 0,
xMin : width,
yMax : 0,
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="HTTP" />
<policy domain="coder" rights="none" pattern="URL" />
<policy domain="coder" rights="none" pattern="FTP" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />