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
# https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore | |
# remove local orphan branches | |
git fetch --prune | |
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d | |
# remove local merged branches | |
git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d |
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
// add a custom toolbar prop to both CommentEdit and CommentCreate | |
// don't use redirect prop! | |
<SimpleForm toolbar={<CommentFormToolbar/>}> | |
// defined as | |
const CommentFormToolbar: VFC<ToolbarProps> = (props) => { | |
const { post_id } = useRecordContext(); | |
return ( |
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
export const downloadSheet = (workbook: ExcelJS.Workbook) => { | |
workbook.xlsx | |
.writeBuffer() | |
.then((buffer) => { | |
// buffer --> blob | |
const blob = new Blob([buffer], { type: 'application/vnd.ms-excel' }); | |
const link = document.createElement('a'); | |
link.download = 'download.xlsx'; | |
link.target = 'blank'; |
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
//Skype | |
//on the call screen | |
let title="Audio Call" | |
document.querySelector(`[title=${title}]`).click(); | |
let i2 = setInterval(() => { | |
console.log('trying...') | |
let b = document.querySelector(`[title=${title}]`).click(); | |
b && b.click(); | |
},1000) |
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 arr = [] | |
document.querySelectorAll('table.table-style-two tbody tr').forEach(row => { | |
let [ case_number, location, age_bracket, gender, info ] = row.innerText.split('\t') | |
let obj = { | |
id: case_number, | |
case_number, | |
status: '', | |
date_confirmed: '', | |
date_suspected: '', | |
location_history: [ |
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('.flightInfo-schedule').forEach(s =>{ | |
let f = s.querySelector('.flightInfo-date'); | |
s.querySelectorAll('.flightInfo-dateItem').forEach(d=>{ | |
let l = d.querySelector('.flightInfo-dateLabel'); | |
if (l && l.innerText === 'Actual:') { | |
let t = d.querySelector('.flightInfo-dateTime'); | |
console.log(f.innerText, t.innerText) | |
}}) | |
}) |
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
// CodaAPI reference: https://script.google.com/macros/library/d/15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl/5 | |
// CodaAPI source: https://script.google.com/d/15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl/edit | |
// Setup and global variables | |
// first, generate an API token at https://coda.io/account | |
// then define apiKey at File > Project Properties > Script | |
var apiKey = PropertiesService.getScriptProperties().getProperty('apiKey'); | |
//Logger.log(apiKey); | |
CodaAPI.authenticate(apiKey); // Replace with your token. |