Skip to content

Instantly share code, notes, and snippets.

View gabrielperales's full-sized avatar
🏠
Working from home

Gabriel gabrielperales

🏠
Working from home
View GitHub Profile
@gabrielperales
gabrielperales / regenerate.js
Created March 1, 2021 16:09
regenerate sourcemap
const { constants } = require('fs');
const { readFile, writeFile, mkdir, access } = require('fs').promises;
const { dirname, basename, sep } = require('path');
const args = process.argv.slice(2);
const [file] = args;
access(file, constants.R_OK).then(async (error) => {
if (error) {
{
"indent" : {
"value": " ",
"ArrayExpression": 1,
"AssignmentExpression": 1,
"BinaryExpression": 1,
"ConditionalExpression": 1,
"CallExpression": 1,
"CatchClause": 1,
"ConditionalExpression": 1,
@gabrielperales
gabrielperales / examples.md
Created November 23, 2015 10:22 — forked from addyosmani/examples.md
Object.observe() examples from my talk

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];