Skip to content

Instantly share code, notes, and snippets.

View nuriofernandez's full-sized avatar
🍡
I love dangos too much

Nurio Fernández nuriofernandez

🍡
I love dangos too much
View GitHub Profile
Field b = Boolean.class.getFields()[1];
b.setAccessible(true);
Field m = Field.class.getDeclaredFields()[4];
m.setAccessible(true);
m.setInt(b, 9);
b.set(null, true);

uBlock rule to block Youtube videos from an specific channel + video lenght shorter than 1 hour.

This is ideal for channels that perform long videos and then upload endless cuts of the original video you already watched.

youtube.com##div.ytd-rich-grid-row:has-text("spicy4tuna"):has(.ytd-thumbnail-overlay-time-status-renderer:has-text(/^([0-5]?[0-9]:[0-6][0-9])$/))
@nuriofernandez
nuriofernandez / DOCUMENTATION.md
Last active December 26, 2023 16:34
Renfe public credit card information script

In a typical credit card number, each block of digits has a specific meaning.

Example number: "1111 2222 3333 4444"

Let's break down the information:

Issuer Identification Number (IIN) or Bank Identification Number (BIN):

The first six digits (in this case, 1111 22) represent the issuer identification number or bank identification number. These digits identify the institution that issued the credit card. The rest of the digits will vary depending on the specific issuer.

@nuriofernandez
nuriofernandez / README.md
Created October 24, 2022 07:44
Fix MacOs disconnecting from iPhone hotspot

Your iPhone hotspot will disconnect devices when them does not performing network request for ~2 minutes.

In order to fix it, you can simply register this ping command to a crontab job for every minute.

crontab -e
* * * * * /sbin/ping 8.8.8.8 -t 1 &>/dev/null
@nuriofernandez
nuriofernandez / no-borders-whatsapp-web.js
Last active December 26, 2024 06:34
web.whatsapp.com remove borders script (for linux desktop app)
const bordersElementPath = "#app > div._1ADa8._3Nsgw.app-wrapper-web.font-fix > div._1XkO3.two";
const removeBorders = () => {
const wrapper = document.querySelector(bordersElementPath);
wrapper.style.top = "inherit";
wrapper.style.width = "inherit";
wrapper.style.height = "inherit";
}
@nuriofernandez
nuriofernandez / Naikito.py
Last active June 16, 2021 23:04
Helping a friend to use structures in python
from dataclasses import dataclass
from typing import List
@dataclass
class Answer:
text: str
score: int
@dataclass
class Question:
@nuriofernandez
nuriofernandez / platzi-course-search.js
Last active January 11, 2021 01:48
Platzi course search improvement
/**
* Deno seems to have a problem with locale related functions.
* https://github.com/denoland/deno/issues/1968
*/
const stringEqualsIgnoreCaseAndAccent = (a, b) => {
const agnostize = (text) => {
let agno = text.toLowerCase();
agno = agno.replace(/[áà]/g, "a");
agno = agno.replace(/[éè]/g, "e");
@nuriofernandez
nuriofernandez / ColoredText.jsx
Created December 24, 2020 02:19
React <ColoredText>something</ColoredText>
import React from 'react';
const ColoredText = ({ children }) => {
return children.split('').map(letter => {
return (
<span style={{ color: getRandomColor() }}>
{letter}
</span>
);
});
@nuriofernandez
nuriofernandez / elapsed-days-tweet.js
Created December 6, 2020 18:12
Automatic day counting script for the @DiasEnVisto tweeter bot account.
// Our Twitter library
const Twit = require("twit");
// Create a Twit instance using the 'config.js' twitter credentials.
const twit = new Twit(require("./config.js"));
// Calculate elapsed days since September 13th
let getElapsedDays = () => {
const oneDay = 24 * 60 * 60 * 1000;
const startingDate = new Date(2020, 8, 13, 15, 54);
@nuriofernandez
nuriofernandez / ApplicationTest.java
Created September 2, 2020 00:26
For-each vs classic for performance testing
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
public class ApplicationTest {
private static Random random = new Random();
private static final int NUM_OF_OPERATIONS = 9999999; // <---- number of entries per iteration