Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Ott matthiasott

View GitHub Profile
@matthiasott
matthiasott / vscode-extensions.sh
Created Apr 23, 2020
A bash script to install Visual Studio Code extensions via the CLI
View vscode-extensions.sh
# https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
code --install-extension aaron-bond.better-comments
# https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
code --install-extension alefragnani.project-manager
# https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client
code --install-extension bmewburn.vscode-intelephense-client
# https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense
@matthiasott
matthiasott / checkConnectionSpeed.js
Last active Aug 23, 2020
Check the current connection speed with the Resource Timing API
View checkConnectionSpeed.js
let fastConnection = false;
/**
* Checks the current connection speed by calculating the time it takes to download a resource
* Uses the Resource Timing API: https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API
*/
const checkConnectionSpeed = function(resource) {
// Check performance support
if (window.performance === undefined) {
console.log("! window.performance NOT supported");
@matthiasott
matthiasott / extractUrls.php
Last active Aug 23, 2020
Extract valid URLs from a given string
View extractUrls.php
<?php
# Extract valid URLs from a given string
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
# Based on WordPress' _extract_urls function (https://github.com/WordPress/WordPress/blob/master/wp-includes/functions.php),
# but using the regular expression by @diegoperini (https://gist.github.com/dperini/729294) – which is close to the perfect URL validation regex (https://mathiasbynens.be/demo/url-regex)
View keybase.md

Keybase proof

I hereby claim:

  • I am matthiasott on github.
  • I am matthiasott (https://keybase.io/matthiasott) on keybase.
  • I have a public key whose fingerprint is A96D F663 082E EAEF 0C22 AD71 D175 59E8 2145 F409

To claim this, I am signing this object:

You can’t perform that action at this time.