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 getInvoiceLinks = () => { | |
const table = document.querySelector('table.new-table.reports'); | |
const [_, tbody] = table.children; | |
const toInvoiceLinkPreview = tr => { | |
const link = `${tr.children[0].children[0].href}&preview=1`; | |
return link.replace('invoices', 'invoice') | |
} | |
const invoiceLinks = Array.from(tbody.children).map(toInvoiceLinkPreview); | |
return invoiceLinks; | |
} |
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
Stop-Process -Name f5fpclientW | |
$wshell = New-Object -ComObject wscript.shell; | |
$config = ([xml](Get-Content account.xml)).root | |
Write-Host $config | |
Invoke-Item -path "C:\Program Files (x86)\F5 VPN\f5fpclientW.exe" | |
Start-Sleep 1 | |
$wshell.AppActivate((Get-Process f5fpclientW).MainWindowTitle) | |
Start-Sleep 1 | |
$wshell.SendKeys('{ENTER}') | |
Start-Sleep 4 |
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
function loginWithBasicAuth(options) { | |
options.secure = options.secure === undefined ? true : options.secure; | |
var popup = window.open(); | |
var credential = | |
encodeURIComponent(options.username) + | |
':' + | |
encodeURIComponent(options.password); | |
var protocol = options.secure ? 'https:' : 'http:'; | |
var link = protocol + '//' + credential + '@' + options.url; | |
popup.location.href = link; |
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 parseColonBasedValues = text => { | |
const regex = /(?<key>.*):\s*(?<value>[^;\n]*)/gim; | |
let result = {}; | |
let parsed; | |
return new Promise((resolve, reject) => { | |
while ((parsed = regex.exec(text))) { | |
const { key, value } = parsed.groups; | |
console.log(key, value); | |
result[key] = value; | |
} |
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 automagica import * | |
import csv | |
# Business Objects | |
def AttachToNotepad(): | |
isRunning = ProcessRunning(name="notepad") | |
if not isRunning: | |
notepad = OpenNotepad() |
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
#include <iostream> | |
#include <string> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cctype> | |
#include <algorithm> | |
using namespace std; | |
int cipher(int f, int s, int mf, int ms); |
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 alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
const charCipher = (first, second) => (firstIndex, secondIndex) => { | |
const firstIndexNum = firstIndex + 1 | |
const secondIndexNum = secondIndex + 1 | |
const result = ((first * firstIndexNum) + (second * secondIndexNum)) % 26 + 1 | |
return result - 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
const speech = new SpeechSynthesisUtterance(); | |
const speaker = speech => message => { | |
speech.text = message; | |
speechSynthesis.speak(speech); | |
}; | |
const speak = speaker(speech); |
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 getSourceCodeLinks = () => { | |
const hrefs = document.querySelectorAll(".source-code-link"); | |
return Array.from(hrefs).map(href => href.href); | |
}; | |
const getModDownloadLinks = () => | |
getSourceCodeLinks().map(link => `${link}/archive/master.zip`); | |
const downloadLinks = links => Promise.all(links.map(link => fetch(link))); |
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
async function getJSON(url) { | |
return await fetch(url, { | |
method: "GET", | |
headers: { | |
"Content-Type": "application/json" | |
} | |
}).then(result => result.json()) | |
} |
NewerOlder