Skip to content

Instantly share code, notes, and snippets.

View eric-khoury's full-sized avatar

Eric Khoury eric-khoury

  • Gothenburg, Sweden
View GitHub Profile
@eric-khoury
eric-khoury / openga.sh
Created October 23, 2022 13:48
Open Google Analytics visitors overview from ${fromDate} to ${today}
#!/bin/bash
fromDate=20190101
today=$(date +'%Y%m%d')
url=https://analytics.google.com/analytics/web/\#/report/visitors-overview/a38738672w193666326p189208417/_u.date00\=${fromDate}\&_u.date01\=${today}\&overview-graphOptions.selected\=analytics.nthMonth
open $url
@eric-khoury
eric-khoury / changedTestIds.sh
Created June 16, 2021 13:55
script used as a git pre-commit script to see if any data-testid has changed in the DOM in the commit
#!/bin/bash
RED='\033[1;31m'
YELLOW='\033[0;33m'
END_COLOR='\e[0m'
currentCommit=$(git show -s --format=%H)
numOfLinesChangedWithTestIds=$(git diff $currentCommit~ $currentCommit -G testid --stat | wc -l)
filesChanged=$(git diff $currentCommit~ $currentCommit -G testid --name-only ':(exclude)changedTestIds.sh')
@eric-khoury
eric-khoury / .eslintrc.json
Last active September 3, 2018 08:33
.eslintrc.json
{
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {
"node": true,
"es6": true
},
"globals": {
@eric-khoury
eric-khoury / reactdragndrop.js
Last active May 8, 2018 21:30
React drag n drop example
state = {
items: ['DRAG ME 1', 'DRAG ME 2', 'DRAG ME 3'],
draggingId: undefined,
droppedId: undefined
}
dragStart = (e) => {
let id = e.target.getAttribute("data-id")
this.setState({ draggingId: id })
}
@eric-khoury
eric-khoury / progressbar.html
Last active May 27, 2016 11:00
Simple html/jquery progressbar
<!DOCTYPE html>
<html>
<style>
body {
width: 80%;
margin: 0 auto;
text-align: center;
padding-top: 200px;
}
#progressWrapper {