Skip to content

Instantly share code, notes, and snippets.

View JarvisPrestidge's full-sized avatar

Jarvis Prestidge JarvisPrestidge

View GitHub Profile
@JarvisPrestidge
JarvisPrestidge / profile.ahk
Created April 23, 2019 20:51
how to precisely profile a hotkey / function in AHK
*F10::
DllCall("QueryPerformanceFrequency", "Int64*", freq)
DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
<Call your code here>
DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
EllapsedMs := (CounterAfter - CounterBefore) / freq * 1000
MsgBox Elapsed QPC time is %EllapsedMs% ms
@JarvisPrestidge
JarvisPrestidge / caps.ahk
Created May 10, 2018 14:38
ahk caps lock timer
#Persistent
#InstallKeybdHook
#SingleInstance force
; Author: Jarvis Prestidge
; Description:
SetTimer, FortniteChecker, 500
return
@JarvisPrestidge
JarvisPrestidge / json
Created April 26, 2018 12:57
Fortnitie-New.kbd.json
[
{
"name": "Fortnite"
},
[
"¬\n`",
{
"c": "#fe6c5e",
"a": 7
},
const input = "5255443714755555317777152441826784321918285999594221531636242944998363716119294845838579943562543247239969555791772392681567883449837982119239536325341263524415397123824358467891963762948723327774545715851542429832119179139914471523515332247317441719184556891362179267368325486642376685657759623876854958721636574219871249645773738597751429959437466876166273755524873351452951411628479352522367714269718514838933283861425982562854845471512652555633922878128558926123935941858532446378815929573452775348599693982834699757734714187831337546474515678577158721751921562145591166634279699299418269158557557996583881642468274618196335267342897498486869925262896125146867124596587989531495891646681528259624674792728146526849711139146268799436334618974547539561587581268886449291817335232859391493839167111246376493191985145848531829344198536568987996894226585837348372958959535969651573516542581144462536574953764413723147957237298324458181291167587791714172674717898567269547766636143732438694473231473258452166457
{ name: 'truelayer-client',
description: 'The official TrueLayer API client library',
'dist-tags': { latest: '1.0.4' },
versions: [ '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4' ],
author: 'Jarvis Prestidge <jarvis@truelayer.com> & Raluca Lehadus <raluca@truelayer.com>',
time:
{ '1.0.3': '2017-10-12T13:02:59.362Z',
'1.0.4': '2017-10-17T12:41:53.885Z',
created: '2017-10-17T12:41:53.885Z',
modified: '2017-10-17T12:41:53.885Z',
@JarvisPrestidge
JarvisPrestidge / gist.ts
Created August 23, 2017 15:56
Conditionally add metadata
const meta: IStringMap<string> = {};
// Conditionally add meta data if not null or undefined
if (Codes.transactionCategoryCodes[transaction.txnCatCde] != null) {
meta.transactionType = Codes.transactionCategoryCodes[transaction.txnCatCde];
}
if (transaction.txnRefNum != null) {
meta.bankTransactionId = transaction.txnRefNum;
}
@JarvisPrestidge
JarvisPrestidge / killme.ts
Last active August 21, 2017 13:12
Accounts API
// Get api dependencies - referer uri & cookies
const referer = await browser.getUrl();
const cookies = await (await browser.getCookies()).get();
const cookie = cookies.map((c: ICookie) => c.name + "=" + c.value).join("; ");
// Identifier for api call
const ajaxIdentifier = await browser.getAttribute(rootAccountSelector, "data-ajax-identifier");
// Fetch account info from accounts api
@JarvisPrestidge
JarvisPrestidge / gist.ts
Created August 21, 2017 09:20
Credit card navigation
/**
* Responsible for collecting credit card specific account information
*
* @param {Browser} browser
* @param {ILogger} logger
* @param {string} selector
*/
const getCreditCardAccountInfo = async (browser: Browser, logger: ILogger, selector: string) => {
// Navigate to statements page
@JarvisPrestidge
JarvisPrestidge / gist.ts
Created August 21, 2017 09:03
Account link from 'displayName'
// Returns the href of the account with the given account title
const accountLink = await browser.evaluate((displayName: string) => {
const accountTitleSelector = "a[id*='lnkAccName_des-m-sat-xx-']";
const titles = [...document.querySelectorAll(accountTitleSelector)] as HTMLAnchorElement[];
const title = titles.filter((ele) => ele.textContent.toLowerCase().includes(displayName.toLowerCase()))[0];
return title ? title.getAttribute("href") : null;
}, account.displayName) as string;
// Get account href from camel-cased display name
if (!accountLink) {

Keybase proof

I hereby claim:

  • I am jarvisprestidge on github.
  • I am jarvisprestidge (https://keybase.io/jarvisprestidge) on keybase.
  • I have a public key ASBy08Nael89D43JraJ00QAugBDyKufvCZIFbwAT6Gr-lwo

To claim this, I am signing this object: