Skip to content

Instantly share code, notes, and snippets.

@mems
mems / akamaiopen.sh
Last active April 27, 2023 12:24 — forked from mousavian/akamai.api.sh
Akamai Open API with Bash
View akamaiopen.sh
#!/usr/bin/env bash
# See also https://github.com/akamai/akamaipowershell
usage() {
cat <<EOT
Usage: ${basename $0} -X value -s value -t value -a value -u value [-d value] [-h]
Options:
-s Client secret
@mems
mems / Third party SLA.md
Last active July 22, 2019 16:36
SLA for website third parties
View Third party SLA.md
@mems
mems / Times-series.md
Last active March 31, 2019 20:40
About time-series data
View Times-series.md

navigator.sendBeacon()

Azure Time Series Insights

It's not Azure Monitor and Application Insights

No Grafana plugin exist yet

@mems
mems / Code coverage.md
Last active September 27, 2022 00:41
Web frontend code coverage
View Code coverage.md

Every line of code we write today will end up as someone’s legacy code.

Everything that you write is going to disappears some day

RUM Code coverage, chose a 1h timeframe (per day) where 1% traffic run that the test

JS coverage

FES javascript instrimentation visualization

@mems
mems / index.html
Last active March 30, 2019 09:57
Webpage resources graph (read HAR)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Webpage resources graph</title>
<script>
function readFileAsText(file){
const reader = new FileReader();
reader.readAsText(file);
return new Promise((resolve, reject) => {
@mems
mems / IFrameResizerLight.js
Last active November 26, 2018 11:13
Light version Iframe resizer
View IFrameResizerLight.js
/*
IFrame Resizer light version
Based on [iframe-resizer](https://github.com/davidjbradshaw/iframe-resizer)
- this version lib to have the base/minimal features
- only use default values
- force resize the iframe when parent window is resized
To avoid memory leaks, only iframes (with a specific classname) that are attached to the document are handled
Window events listeners are shared.
If the iframe is removed from document (detached nodes) subsequent message events are ignored
@mems
mems / ASP.Net dependency graph.md
Last active February 14, 2023 22:33
Build dependency graph of an ASP.Net project
View ASP.Net dependency graph.md

For all files: HTML, JS, CSS, LESS, CSHTML, ASCX, ASPX, CS (SVC) And config files XML, JSON

Write a webpack loader to load backend templates dependencies.

C# Razor and Web Forms templates

Entry points: ^[^_].*\.cshtml$ and .aspx$ should be an entries points

  • WebForm templates (ASPX use ASCX controls) files are HTML/XML with processing instruction nodes
@mems
mems / icloudtabs2md.js
Last active February 26, 2023 21:38
Generate a markdown links list from iCloud tabs
View icloudtabs2md.js
#!/usr/bin/env node
/*
Generate a markdown links list from iCloud tabs, on macOS
Usage:
./icloudtabs2md.js > icloudtabs.md
./icloudtabs2md.js | pbcopy
Require: