Skip to content

Instantly share code, notes, and snippets.

@YOU54F
YOU54F / items.json
Last active June 17, 2020 16:41
Configuration file for My TouchBar. My rules - https://github.com/Toxblh/MTMR
[
{ "type": "escape", "align": "left" },
{
"type": "appleScriptTitledButton",
"source": {
"inline":
"if application \"iTunes\" is running then\rtell application \"iTunes\"\rif player state is playing then\rreturn (get artist of current track) & \" – \" & (get name of current track)\relse\rreturn \"\"\rend if\rend tell\rend if\rreturn \"\"\r"
},
"action": "appleScript",
"actionAppleScript": {
@YOU54F
YOU54F / Cypress_instuctions.md
Last active May 11, 2019 00:06
Instructions for running Cypress with iFrames / X-origin in Chrome headed

Cypress & iFrames/x-origin issues.

Currently working Browsers & Modes

  • Chrome Headed
    • Cypress UI
    • Cypress CLI
  • Chrome Headless
    • Cypress UI
  • Cypress CLI
@YOU54F
YOU54F / config.yml
Created May 16, 2019 19:52
Cypress Microsoft Edge MacOSX - CircleCI config
version: 2.1
jobs:
test:
macos:
xcode: 10.1.0
working_directory: ~/app
steps:
- checkout
- run:
@YOU54F
YOU54F / account.md
Last active October 4, 2023 13:52
Bank account details for testing purposes - trigger various IBAN errors

Bank Account Test Details

No Description of test case Sort code Accountnumber Valid flag Response
1 Pass modulus 10 check 089999 66374958 Y
2 Pass modulus 11 check 107999 88837491 Y
3 Pass modulus 11 and double alternate checks. 202959 63748472 Y
4 Exception 10 & 11 where first check passes and second check fails. 871427 46238510 Y
5 Exception 10 & 11 where first check fails and second check passes. 872427 46238510 Y
6 Exception 10 where in the account number ab=09 and the g=9. The first check passes and second check fails. 871427 09123496 Y
@YOU54F
YOU54F / getStarredRepos.sh
Last active October 24, 2020 02:21
Get starred repos and create a markdown file
#!/bin/bash
USER=${1:-YOU54F}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
@YOU54F
YOU54F / merge_all_prs.sh
Created May 5, 2021 19:52
merge all open PR's across all repos for a github userr
for repo in $(gh repo list -L 100 | awk {'print $1}'); do
for pr_no in $(gh pr list -R $repo | awk {'print $1}'); do
gh pr merge -R $repo -s $pr_no
done
done
@YOU54F
YOU54F / mswpact.md
Created March 11, 2022 19:02
Keeping your Mocks in check, with Pactflow + Mock-Service-Worker

Keeping your Mocks in check, with Pactflow + Mock-Service-Worker

Web Service workers, you may not have heard of them but they help provide rich offline experiences, periodic background syncs, push notifications—functionality that would normally require a native applications


service worker

Now as much as I love rich web experiences, I know from first hand experience, how painful they can be to test. Thankfully the OSS community heard our collective cry and the msw.js team created Mock Service Worker

I’ll let them explain in their own words why -

@YOU54F
YOU54F / clone_all_pact_org_repos.sh
Created March 29, 2022 14:59
Clone all of the pact-organisation repos
#!/bin/sh
export ORG=pact-foundation
mkdir $ORG; cd $ORG
gh repo list $ORG --limit 9999 --json url | jq '.[]|.url' | xargs -n1 git clone
@YOU54F
YOU54F / update_git_repos.sh
Created March 29, 2022 15:31
Update all them git repos whether they are on main or master. Gotta sync em all
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "[Pulling in latest changes for all repositories...]"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@YOU54F
YOU54F / language.md
Last active October 4, 2023 13:54
Various Pact getting starting snippets, (language tabs for docusaurus)