Skip to content

Instantly share code, notes, and snippets.

View lordgraysith's full-sized avatar
🐿️
Eternally distracted

Michael Graybeal lordgraysith

🐿️
Eternally distracted
View GitHub Profile
@lordgraysith
lordgraysith / member-list.js
Created May 23, 2020 21:48
Extracts member info from the member list page in LCR
const rawMembers = $('.member-list tr.ng-scope').splice(0)
const members = rawMembers.reduce((acc, mem) => {
return acc.concat([{
name: $(mem).find('td.fn span')[0].textContent,
sex: $(mem).find('td.sex')[0].textContent,
age: parseInt($(mem).find('td.age')[0].textContent),
phone: $(mem).find('td.phone span a')[0].textContent
}])
}, [])
function openTransactions() {
const drawers = document.getElementsByClassName('openDrawerButton')
const drawersArray = [].slice.call(drawers)
const recursivelyOpen = function(index) {
if (index < drawersArray.length) {
drawersArray[index].click()
setTimeout(recursivelyOpen, 5000, index + 1)
}
}
recursivelyOpen(1)
@lordgraysith
lordgraysith / Soft Hyphen
Created August 30, 2018 12:55
This is a soft hyphen. Unicode U+00AD Alt Code 0173. I like to use it for leaving required fields blank while passing validation on those fields. Macs don't have an easy way to enter alt codes, so you can just copy the contents of this gist and paste it where you need it.
­

Keybase proof

I hereby claim:

  • I am lordgraysith on github.
  • I am lordgraysith (https://keybase.io/lordgraysith) on keybase.
  • I have a public key ASDxVYCdvQdQC4_VHz-fQOppq4w_1nXzcrhvknm1ynhU5go

To claim this, I am signing this object:

const deleteAllJobs = function() {
const elements = document.getElementsByClassName('remove')
const links = [].slice.call(elements)
links.map(link => link.click && link.click())
}
@lordgraysith
lordgraysith / regex-and-replace.txt
Last active March 16, 2017 17:51
import/export to commonJS
import\s([a-z0-9{},]+)\sfrom\s('[a-z\-./]+')
const $1 = require($2)