Skip to content

Instantly share code, notes, and snippets.

View bertolo1988's full-sized avatar
🎯
Focusing

Tiago Bértolo bertolo1988

🎯
Focusing
View GitHub Profile
@bertolo1988
bertolo1988 / how-to-clone-prototype-by-copying.js
Last active October 12, 2022 09:20
How to clone a javascript object without just referencing the prototype.
// How to clone a javascript object without just referencing the prototype
const assert = require('node:assert')
const input = { a: 1 }
// every prototype is an object with normal property descriptors
const prototypeDescriptors = Object.getOwnPropertyDescriptors(
Object.getPrototypeOf(input)
)
@bertolo1988
bertolo1988 / connect_linkedin.js
Last active July 12, 2024 12:49
Quickly your LinkedIn network
// 1. load https://www.linkedin.com/mynetwork/
// 2. make sure your LinkedIn is in English
// 3. paste this script on chrome dev tools at your own risk
async function moreConnectionsPlease() {
// maximum limit of Connect buttons clicked
const LIMIT = 500;
// wait in ms before each scroll
const SCROLL_TIMEOUT = 600;
// bulk scroll will scroll this amount of times
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)