Skip to content

Instantly share code, notes, and snippets.

View RamonCP's full-sized avatar
😁
Happy

Ramon Cavalcante RamonCP

😁
Happy
  • PWS Cloud
  • São Paulo - SP, Brasil
View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active January 29, 2026 09:20
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@nntrn
nntrn / espn-api-list.md
Last active May 1, 2026 18:29
List of nfl endpoints for ESPN's API

List of NFL API Endpoints

This page has been updated a lot in the past 3 years. Older revisions you might like more than this one:

@tajnymag
tajnymag / tinder.user.js
Last active December 2, 2025 16:42
Tinder Deblur Userscript (ARCHIVED and DEPRECATED, see https://github.com/tajnymag/tinder-deblur)
// ==UserScript==
// @name Tinder Deblur
// @namespace Violentmonkey Scripts
// @match https://tinder.com/*
// @grant none
// @version 1.4
// @author Tajnymag
// @downloadURL https://raw.githubusercontent.com/tajnymag/tinder-deblur/main/tinder.user.js
// @description Simple script using the official Tinder API to get clean photos of the users who liked you
// ==/UserScript==
@TaylorAckley
TaylorAckley / pager.js
Last active August 15, 2021 04:54
Simple Paging Example
require('dotenv').config();
const request = require('request-promise');
// Hoist our users array.
let users = [];
const API_ENDPOINT = `https://publicapi.knowledgeanywhere.com`;
const CLIENT_ID = process.env.LMS_CLIENT_ID; // Loaded from our .env file
const CLIENT_SECRET = process.env.LMS_CLIENT_SECRET; // Loaded from our .env file
const PAGE_SIZE = 1000; // How many records the API returns in a page.
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active April 12, 2026 12:55
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@marcelo-ribeiro
marcelo-ribeiro / javascript-remove-accents.js
Last active April 7, 2026 13:18 — forked from fabiofdsantos/angularJS_removeAccents.js
An Javascript function to remove accents and others characters from an input string.
// Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW
const accentsMap = new Map([
["A", "Á|À|Ã|Â|Ä"],
["a", "á|à|ã|â|ä"],
["E", "É|È|Ê|Ë"],
["e", "é|è|ê|ë"],
["I", "Í|Ì|Î|Ï"],
["i", "í|ì|î|ï"],
["O", "Ó|Ò|Ô|Õ|Ö"],
@rafaelstz
rafaelstz / get.js
Last active February 8, 2026 16:32
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.
@lopspower
lopspower / README.md
Last active April 29, 2026 15:47
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@telekosmos
telekosmos / uniq.js
Last active December 26, 2025 08:37
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});