This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rows = document.querySelectorAll('tr.mat-mdc-row'); | |
let emailByUid = {}; | |
for (const row of [...rows]) { | |
const email = row.querySelector('td:nth-child(1)').innerText; | |
const uid = row.querySelector('td:nth-child(5)').innerText; | |
if (email && uid) emailByUid[uid] = email; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test if python is installed | |
if [ -z "$(which python)" ]; then | |
# if not installed then install python | |
echo "Python is not installed. Installing python..." | |
sudo apt-get install python | |
echo "Python installed successfully." | |
fi | |
# test if homebrew is installed | |
if [ -z "$(which brew)" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your info here | |
GITHUB_USERNAME="your_username" | |
AUTHOR_NAME="Your Name" | |
INIT_COMMIT_MESSAGE="init: setup basic react app using webpack and typescript" | |
# create-react-app | |
git clone "[email protected]:$GITHUB_USERNAME/$1.git" | |
cd "$1" | |
# create package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. Install hub on your machine (https://hub.github.com) | |
# 2. Add this file to your project and update your package.json | |
# "scripts": { | |
# "pull-request": "sh ./path/pull-request.sh" | |
# } | |
# 3. Run "npm run pull-request" to open a pull request | |
REMOTE=$(echo `git remote get-url origin` | sed -e 's/.*:\(.*\)\/.*/\1/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Adobe Semaphore Data Capture | |
Author: @jadeallencook | |
Date: May 13, 2023 | |
This script captures the position sequences of the semaphore wheels from the Adobe Semaphore public art installation. | |
The script queries the semaphore's website, maps the transform styles of the wheel elements to their positions, | |
and stores the sequences of positions in an array. The script logs every captured sequence, and logs the progress | |
every 10 sequences. Once the script has captured a predetermined maximum number of sequences, it logs the entire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const insert = (type, result) => { | |
const base64 = `data:${type};base64,${btoa(result)}`; | |
const rows = document.querySelectorAll('div._ac7v'); | |
let images; | |
let clone = document.querySelector('div._ac7v > div._aabd').cloneNode(); | |
clone.innerHTML = ''; | |
clone.style.background = `url(${base64})`; | |
clone.style.backgroundPosition = 'center center'; | |
clone.style.backgroundSize = 'cover'; | |
for (let row of rows) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let investments = 0; | |
let loses = 0; | |
let gains = 0; | |
let down = []; | |
let up = []; | |
document | |
.querySelectorAll('span.theme-closed-down') | |
.forEach(elem => { | |
investments++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flatten = array => array.reduce((temp, value) => temp.concat(Array.isArray(value) ? flatten(value) : value), []); | |
// example | |
console.log(flatten([[['str']],undefined,null,{},[[true,false],[{},[]],[],{}],[],[],[],[]])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('#index').forEach(elem => { | |
elem.style.cursor = 'pointer'; | |
elem.onclick = function() { | |
menu = this.parentNode; | |
this.style.color = 'red'; | |
menu.querySelectorAll('#button')[0].click(); | |
document.querySelectorAll('paper-listbox#items')[0].children[1].click(); | |
document.querySelector('.checkbox-height[title="YOUR PLAYLIST NAME"]').click(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import merge from 'lodash/merge'; | |
export default function rjsBind(event) { | |
const path = event.target.getAttribute('data-path'), | |
paths = path.split('-'), | |
value = event.target.value; | |
let object = {}; | |
paths.reduce(([object, value], path, idx) => { | |
object[path] = idx === paths.length - 1 ? value : {}; | |
return [object[path], value]; |
NewerOlder