Skip to content

Instantly share code, notes, and snippets.

View Agezao's full-sized avatar
🦉
.

Gabriel Age Agezao

🦉
.
View GitHub Profile
var masterTile = document.querySelectorAll('div[jsname="v2aOce"]')[0];
var masterVideoContainerTile = document.querySelectorAll('div[jsname="v2aOce"] div[jscontroller="jb5WPb"]')[0];
var videoContainerTile = document.querySelectorAll('div[jsname="v2aOce"] div[jsname="Nl0j0e"]')[0];
var videoTile = document.querySelectorAll('div[jsname="v2aOce"] div[data-ssrc="146904037"]')[0];
var width = 15;
var height = 15;
masterTile.style.right = 0;
masterTile.style.top = `calc(100vh - ${height * 0.55 + height}vh)`;
@Agezao
Agezao / submodule.sh
Created August 6, 2019 17:37
Starting git submodule
git submodule add --name "nickname" -b "master" https://bitbucket.org/yourrepo/cool.git custom/path
@Agezao
Agezao / diff-object.js
Created July 12, 2019 16:41
Calculating changes between two objects
const original = {
a: 1,
b: 2,
c: 3,
d: 4
};
const updated = {
a: 1,
b: 4,
@Agezao
Agezao / parallel-batch.js
Created July 12, 2019 15:19
Node.js parallel batch processing
async doSomethingWithBigArray(bigArray) {
const arrayBatch = [];
const batchSize = 30;
while (bigArray.length > 0) arrayBatch.push(bigArray.splice(0, batchSize));
for (let i = 0; i < arrayBatch.length; i++) {
const batch = arrayBatch[i];
await Promise.all(batch.map(async (arrayItem) => {
await this.doSomethingWithItem(arrayItem);
}));
@Agezao
Agezao / reset.sh
Created April 25, 2019 14:48
Reset mac webcam
sudo killall VDCAssistant
@Agezao
Agezao / nbinance.6s.sh
Created April 1, 2019 21:50
Binance Ticker for Bitbar
#!/bin/bash
# <bitbar.title>Binance Prices</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Gabriel Age</bitbar.author>
# <bitbar.author.github>agezao</bitbar.author.github>
# <bitbar.dependencies>bash, python</bitbar.dependencies>
bitcoin_icon='iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAACXBIWXMAABYlAAAWJQFJUiTwAAABY0lEQVRIx2P4z0AdyEBzg1DAdIYfQJgCZHmCWdsYMAFRBs0BC2UAWT5g1p6hbZAggwIcrgALVQNZSWDWAQY24g3qwRtJ/xgeMqxkCGJgotQgGLzAoEUdg/4zvGQQIxzYLAyODF/gQv0MlgwWDK4MOQxbgV5DKG0nLtZ2wIUykII2EMmoU8QZtAWrQQwMB+HiDygzaDNc/CQlBskwfIKLN5JrkAxDFsMTuOh9BiFSDXoHDI2HDB9RlJ1kECc2r20hkI5OMXhQxyAQzCTNoDJgaAgAvaLLEMkwn+EbkuLvDBLkR78yUoD/Z0gn3yAGhnwk5V2UGBRGLYNmICkvIGzQLqwG8TA0oJQAVvgMymcoYehg+AUXWgoM0kygWC/DbpQ4+89wjYERt0FiRNeNX4GlFJ505EykMacZDPGn7HwCBnxiOMcwjcGJcOEvzqADh2vBQk1AVhaYdZCBc7TKpqJBA9ZiAwDMH49EXcmY2QAAAABJRU5ErkJggg=='
@Agezao
Agezao / venv.sh
Last active April 1, 2020 21:16
Python virtual envs
# Create
virtualenv xpto
#Activate
source mypython/bin/activate
pip3 install -r requirements.txt
#Deactivate
deactivate
@Agezao
Agezao / submodules-updating.sh
Created March 18, 2019 18:14
Submodule cloning/updating
#After cloning
git submodule update --init --recursive
#On pull
git submodule update --recursive
@Agezao
Agezao / gist:7d03ea220ba21cd386978bfe650d47c4
Created February 8, 2019 11:57
Branch delete local + remote
git push --delete <remote_name> <branch_name>
git branch -d <branch_name>
docker run --name mongo36 -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=noice -v c:\dev\mdb:/data/db -d -p 27017:27017 mongo:3.6.6