Skip to content

Instantly share code, notes, and snippets.

View PterPmnta's full-sized avatar
💭
FullStack Web Developer

Pedro Pimienta M. PterPmnta

💭
FullStack Web Developer
View GitHub Profile
@wparad
wparad / responsive-toolkit.js
Last active October 5, 2021 10:19
Reactive javascript triggered by bootstrap media queries
const xs = document.createElement('div');
xs.setAttribute('class', 'd-inline d-sm-none');
const sm = document.createElement('div');
sm.setAttribute('class', 'd-none d-sm-inline d-md-none');
const md = document.createElement('div');
md.setAttribute('class', 'd-none d-md-inline d-lg-none');
const lg = document.createElement('div');
@Klerith
Klerith / db.json
Last active March 9, 2023 19:51
Base de datos rápida - json-server
{
"usuarios": [
{
"id": 1,
"usuario": "John Doe",
"email": "[email protected]"
}
],
"heroes": [
{
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
rules: {
@vades
vades / angular-expression-changed.md
Last active January 17, 2025 12:29
Fixing "Expression has changed after it was checked" in Angular

Fixing "Expression has changed after it was checked" in Angular

The exception appears (in the development mode) at the moment the value is checked and value is different of the updated value.

Error message example

AppComponent.html:1 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: true'. Current value: 'ngIf: false'.
    at viewDebugError (core.js:20440)
    at expressionChangedAfterItHasBeenCheckedError (core.js:20428)
    at checkBindingNoChanges (core.js:20530)
@toraritte
toraritte / add_user_and_reset_password_with_Firebase_admin_on_node.md
Last active May 10, 2024 13:10
Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

1. Install Firebase's Node modules

Install the Firebase Node modules:

$ npm install firebase firebase-admin --save
@Klerith
Klerith / parse-jwt.js
Created March 15, 2018 15:07
Parse - JWT - Obtener Payload y fecha de creación y expiración
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
@coreequip
coreequip / short-ali.userscript.js
Last active August 29, 2022 17:32 — forked from eremin/ageShot.js
Aliexpress/eBay/Gearbest URL Shortener
// ==UserScript==
// @name Aliexpress/eBay/Gearbest/Amazon URL Shortener
// @namespace http://tampermonkey.net/
// @version 0.5
// @author hedgehog, core.equip
// @match https://*.aliexpress.com/item/*
// @match https://*.ebay.de/itm/*
// @match https://*.ebay.com/itm/*
// @match https://*.gearbest.com/*
// @match https://*.amazon.de/*
@codediodeio
codediodeio / database.rules.json
Last active January 10, 2025 22:28
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@Houserqu
Houserqu / action.js
Last active April 2, 2018 14:50
React
import 'whatwg-fetch';
import {openSnackbar} from '../../public/action/globalAction';
export function setAttractions(attractions){
return {
type:'SET_ATTRACTIONS',
attractions:attractions
}
}
@nerdyman
nerdyman / resolve-tsconfig-path-to-webpack-alias.js
Last active March 26, 2025 13:00
Convert TypeScript tsconfig paths to webpack alias paths
const { resolve } = require('path');
/**
* Resolve tsconfig.json paths to Webpack aliases
* @param {string} tsconfigPath - Path to tsconfig
* @param {string} webpackConfigBasePath - Path from tsconfig to Webpack config to create absolute aliases
* @return {object} - Webpack alias config
*/
function resolveTsconfigPathsToAlias({
tsconfigPath = './tsconfig.json',