Skip to content

Instantly share code, notes, and snippets.

View rafaelcardoso's full-sized avatar
🐰

Rafael Cardoso rafaelcardoso

🐰
View GitHub Profile
@mathisonian
mathisonian / index.md
Last active March 22, 2023 05:31
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@gustavopaes
gustavopaes / storageValidation.js
Last active December 19, 2015 22:08
Verifica se o navegador possui suporte ativo / liberado para o uso da API localStorage.
/**
* Valida se o usuário está habilitado para usar a API localStorage.
* https://gist.github.com/gustavopaes/6024904
* @type {Boolean}
*/
var storageValidation = (function(window) {
'use strict';
var validation;
try {
// IE <= 9 e demais navegadores devem retornar TRUE
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",