Skip to content

Instantly share code, notes, and snippets.

View Dalimil's full-sized avatar
:octocat:
Building Web Experiences at Edge Delta

Dalimil Hajek Dalimil

:octocat:
Building Web Experiences at Edge Delta
View GitHub Profile
@Dalimil
Dalimil / ngrok_url.sh
Created March 10, 2017 13:52
Get ngrok URL from command line
# ngrok should be running
# replace http with https at the end if needed
# based on: https://gist.github.com/rjz/af40158c529d7c407420fc0de490758b
echo $(curl -s localhost:4040/inspect/http | grep -oP 'window.common[^;]+' | sed 's/^[^\(]*("//' | sed 's/")\s*$//' | sed 's/\\"/"/g') | jq -r ".Session.Tunnels | values | map(.URL) | .[]" | grep "^http:"
@Dalimil
Dalimil / Vector2.js
Created July 11, 2016 15:56
Basic Vector2 JavaScript Math Helper Class
function Vector2(x, y) {
this.x = (x === undefined) ? 0 : x;
this.y = (y === undefined) ? 0 : y;
}
Vector2.prototype = {
set: function(x, y) {
this.x = x || 0;
this.y = y || 0;
},