Skip to content

Instantly share code, notes, and snippets.

View felquis's full-sized avatar
💻
Coding since 2011 ☕ fueled by curiosity 🔍 always exploring

Ofelquis G felquis

💻
Coding since 2011 ☕ fueled by curiosity 🔍 always exploring
View GitHub Profile
@felquis
felquis / script.js
Created March 18, 2026 20:37
Remove gradient backgrounds from any website
javascript:(function(){
// ────────────────────────────────────────────────
// Helpers
// ────────────────────────────────────────────────
function hasGradient(value) {
return /gradient|linear-gradient|radial-gradient|repeating-/i.test(value || '');
}
function isGradientTextLike(style) {
@felquis
felquis / readme.md
Last active March 18, 2026 03:43
React Miami 2026 Full Schedule + Talk Description markdown file

React Miami 2026 - All talk's descriptions in a single Markdown file.

Event: React Miami 2026 – The Ultimate React Conference in the US
Location: Hyatt Regency Miami
Source: https://www.reactmiami.com/schedule + páginas individuais de speakers
Compiled Date: 18 March 2026
Note: Only talks with speaker detail links were included (breaks, lunches, parties and TBDs doesn't have descriptions).


@felquis
felquis / content_script.js
Last active March 13, 2026 22:36
chrome web store analytics pro - get daily install vs uninstall conversation rate.
(() => {
const TARGET_CLASS_PATTERN = /^ds:\d+$/;
const TARGET_KEYS = new Set(["ds:5", "ds:6"]);
function getTargetScripts(root = document) {
return Array.from(root.querySelectorAll("script[class]"))
.filter((scriptEl) =>
Array.from(scriptEl.classList).some((className) => TARGET_CLASS_PATTERN.test(className))
);
}
@felquis
felquis / t.js
Last active March 4, 2026 19:01
executes a function and return go like array, first success return, second the error if any (inspired by https://www.npmjs.com/package/try)
export const t = async (f) => {
let output = undefined
let error = undefined
try {
output = f()
} catch(e) {
error = e
}
@felquis
felquis / whats-the-next-letter.js
Created January 22, 2026 20:38
Predict the next letter in `O, T, T, F, F, S, S, E, ?` using bigram model of `onetwothreefourfivesixseveneightnineteneleventwelvethirteen`
// Hi my name is Ofelquis and I've been studying equations and algorithms with Grok,
// I didn't write this code, it's just food for thought enjoy and read more about the works of shannon claude
// Bigram-based next-letter predictor with probability distribution
// Trains on a corpus, computes P(next | current), logs probs for ALL A-Z letters, then the highest
function buildBigramModel(corpus) {
const counts = {};
const totals = {};
@felquis
felquis / ViewController.swift
Created December 8, 2024 05:52
My first SwiftUI Hello World - View centered vertically and horizontally, on every tap it changes colors and count number of taps
//
// ViewController.swift
// CenterElement
//
import UIKit
import SwiftUI
class ViewController: UIViewController {
var squareView: UIView!
@felquis
felquis / onControlledInputChange.tsx
Created February 18, 2023 15:18
Use this callback on all input's onChange prop, inputs must have proper type and name matching the state
function Example() {
const defaultInputValues = {
name: "", // should match input's name prop
email: "",
address_line_1: "",
birthday: "",
}
const [controlledFields, setControlledFields] = useState({
...defaultInputValues,
@felquis
felquis / load-global-stylesheet-async.js
Created June 8, 2020 21:24
Yet Another Snippet to load global stylesheets
/*
Usage: loadStyles([{
href:
'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons',
},
{
href:
'https://unpkg.com/bootstrap-material-design@4.0.0-beta.4/dist/css/bootstrap-material-design.min.css',
integrity:
'sha384',
@felquis
felquis / load-global-javascript-async.js
Last active June 8, 2020 21:40
Yet Another Snippet to Load JavaScript files async with promises.
/*
Usage: loadJavaScriptFiles([{
href:
'https://path-to',
},
{
href:
'https://unpkg.com/cdn-path-to',
integrity:
'sha384',
@felquis
felquis / readme.md
Created December 3, 2019 15:17
How to submit a form on ENTER without a submit button

If you have a form, and in the design specs there's no submit button inside the form, you can still make the form submit when the user presses enter. You just need to put a hidden input of type submit.

<form>
  <input type="text" name="anything" />
  <input type="submit" hidden />
</form>

That is it for today. Questions in the comment field bellow, thanks.