Skip to content

Instantly share code, notes, and snippets.

View dainemawer's full-sized avatar
🏠
Working from home

Daine Mawer dainemawer

🏠
Working from home
View GitHub Profile
@dainemawer
dainemawer / determine-sticky-state.js
Created March 14, 2024 06:00
Determine Sticky State in JavaScript - Daine Mawer
let stickyElementStyle = null;
let stickyElementTop = 0;
function determineStickyState(element) {
if (!stickyElementStyle) {
stickyElementStyle = window.getComputedStyle(element);
stickyElementTop = parseInt(stickyElementStyle.top, 10);
}
@dainemawer
dainemawer / main.yml
Created April 5, 2022 05:35
Github Lighthouse Server Config
name: Lighthouse
on: push
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Lighthouse on urls and upload data to private lhci server
uses: treosh/lighthouse-ci-action@v9
with:
@dainemawer
dainemawer / main.yml
Created April 5, 2022 05:34
Github Lighthouse CLI Config
name: Lighthouse CI
on: push
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v9
with:
@dainemawer
dainemawer / .gitlab-ci.yml
Last active April 5, 2022 05:35
Lighthouse Gitlab CLI Config
lhci:
image: cypress/browsers:node16.5.0-chrome94-ff93
script:
- npm ci
- npm run build
- npm install -g @lhci/cli@0.8.x
- lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir="./projects/hola-magazine/.next" --collect.settings.chromeFlags="--no-sandbox" || echo "LHCI failed!"
@dainemawer
dainemawer / .gitlab-ci.yml
Last active April 5, 2022 05:35
Lighthouse Server Gitlab CI Config (GitLab)
variables:
LHCI_TOKEN: "$TOKEN"
SERVER_BASE_URL_VAR: "$SERVER_BASE_URL"
AUTH_USERNAME: $BASIC_AUTH_USERNAME
AUTH_PASS: $BASIC_AUTH_PASS
lhci:
image: cypress/browsers:node16.5.0-chrome94-ff93
script:
- npm ci