Skip to content

Instantly share code, notes, and snippets.

View JakubNer's full-sized avatar

Jakub Ner JakubNer

View GitHub Profile
@JakubNer
JakubNer / frontend-ws-connection.ts
Created May 23, 2019 18:55 — forked from jsdevtom/frontend-ws-connection.ts
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@JakubNer
JakubNer / rejig_timeline_labels_events.js
Created September 16, 2018 23:16
Google Web Designer (workaround): insert time in front of labels and events at some point on the timeline.
var AT_SECONDS = 0;
var INSERT_SECONDS = 0;
// Replace the string below with the text of the element containing labels and events that need to be shifted.
var STR = `
`
// Grab string of timeline labels from attribute 'data-gwd-animation-labels' for an element. Make
// timeline space 'at_seconds'. Insert 'insert_seconds' of space. Console output are the new labels.
@JakubNer
JakubNer / variabilize.jjs
Created September 6, 2018 23:16
A Nashorn (JavaScript) script to search out variable definitions in comments and use their values in other places in the file where placeholder comments are present.
// This is a Nashorn (JavaScript) script to search out variable definitions in comments and use their values
// in other places in the file where placeholder comments are present.
//
// SYNOPSIS
//
// jjs variablize.jjs -- ${PATH}
//
// DESCRIPTION
//
// Go through file at ${PATH} and search out all variable definitions as per regular expression: