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.querySelector('.eds-g-group').append( | |
...[...document.querySelectorAll('.eds-g-cell.eds-g-cell--has-overflow.eds-g-cell-1-1.eds-g-cell-mn-9-12')] | |
.map((elem) => ({ | |
date: new Date(elem.querySelector('.eds-text-bs--fixed.eds-text-color--ui-600.eds-l-mar-top-1').innerText), | |
elem | |
})) | |
.sort((a,b) => -(b.date - a.date)) | |
.map(({elem}) => elem) | |
) |
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 jq = document.createElement('script'); | |
jq.src = 'https://code.jquery.com/jquery-3.5.1.min.js'; | |
document.head.appendChild(jq); |
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
<?php | |
$servername = "localhost"; | |
$username = ""; | |
$password = ""; | |
$dbname = ""; | |
function drawRow($row){ | |
?> | |
<article> | |
<h2><?php echo $row["id"]. " " . $row["name"]?></h2> |
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('.qV')] | |
.map((elem) => ({ | |
matches: elem.querySelector('.qW').innerText, | |
action: elem.innerHTML.split('<br>')[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
[...document.querySelectorAll('.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer')] | |
.map((elem) => | |
`${elem.querySelector('#video-title').innerText} ${elem.href}` | |
.replace(/&list=WL.*/, '')) | |
.join('\n') |
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
# From https://stackoverflow.com/a/35165401 | |
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - | |
sudo yum install gcc-c++ make | |
sudo yum -y install nodejs |
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
# amazon-linux-extras doesn't seem to be around now | |
# Hopefully depricated? | |
sudo yum update -y | |
sudo yum install docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user |
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
processTable = (table) => { | |
rows = table.querySelector('tbody').children; | |
rows = [...rows].map((r) => { | |
const link = r.children[0].children[0]; // Get the hyperlink from cell 1 | |
let {href, innerText} = link; | |
innerText = innerText.split(' ').filter((x) => !(['Professor', 'Dr', 'Mr', 'Mrs', 'Miss', 'Ms'].includes(x))).join(' '); | |
return {href, innerText} | |
}) | |
output = rows.map(({href, innerText}) => `${innerText} ${href}`).join('\n'); | |
console.log(output); |
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
alert('hello world'); |
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
Show hidden characters
{ | |
"extends": ["eslint:recommended", "google"], | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module" | |
}, | |
"rules": { | |
"no-console": "off" |
NewerOlder