Skip to content

Instantly share code, notes, and snippets.

View lancevo's full-sized avatar

Lance Vo lancevo

View GitHub Profile
@lancevo
lancevo / generate_mac.bash
Created May 20, 2019 18:03
change MAC address on Mac
function changeMac() {
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
sudo ifconfig en0 ether $mac
sudo ifconfig en0 down
sudo ifconfig en0 up
echo "Your new physical address is $mac"
}
@lancevo
lancevo / README.md
Created June 3, 2019 19:23 — forked from egucciar/README.md
Shadow Dom Commands

ShadowDom

Quick Start

In the index.js or the root file of your cypress/support folder,

@lancevo
lancevo / filterarrayinplace.js
Created August 13, 2019 14:12
Filter array in place
function filterInPlace(array, condition) {
let iOut = 0;
for (let i = 0; i < array.length; i++) {
if (condition(array[i])) {
array[iOut++] = array[i];
}
}
array.length = iOut;
}
@lancevo
lancevo / mysql-docker.sh
Created September 26, 2019 21:45 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@lancevo
lancevo / letsencrypt.md
Created June 2, 2021 17:09
Set up letsencrypt with nginx and node