Skip to content

Instantly share code, notes, and snippets.

View maslick's full-sized avatar
🙃
AWS, MLOps, Airflow/MWAA, dbt

Paul Maslov maslick

🙃
AWS, MLOps, Airflow/MWAA, dbt
View GitHub Profile
@maslick
maslick / fixIOSAudioContext.js
Created January 12, 2022 10:22 — forked from kus/fixIOSAudioContext.js
Fix iOS AudioContext on Safari not playing any audio. It needs to be "warmed up" from a user interaction, then you can play audio with it as normal throughout the rest of the life cycle of the page.
// Fix iOS Audio Context by Blake Kus https://gist.github.com/kus/3f01d60569eeadefe3a1
// MIT license
(function() {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
if (window.AudioContext) {
window.audioContext = new window.AudioContext();
}
var fixAudioContext = function (e) {
if (window.audioContext) {
// Create empty buffer
@maslick
maslick / gist:7e58d606943a1244a6b2c78289fe2b63
Created January 10, 2017 23:06 — forked from bleathem/gist:50b4dd2fd4377503eaad
Creating an Rx.js Observable from a STOMP over Websocket source (with error handling)
// see: https://github.com/jmesnil/stomp-websocket
var client = Stomp.client('ws://...');
client.debug = undefined;
var live = Rx.Observable.create(function (observer) {
console.log('Connecting...')
client.connect(username, password, function(frame) {
console.log(frame.toString());
observer.onNext(frame);
@maslick
maslick / jsonp.js
Created September 22, 2016 22:06 — forked from gf3/jsonp.js
Simple JSONP in vanilla JS
/**
* loadJSONP( url, hollaback [, context] ) -> Null
* - url (String): URL to data resource.
* - hollaback (Function): Function to call when data is successfully loaded,
* it receives one argument: the data.
* - context (Object): Context to invoke the hollaback function in.
*
* Load external data through a JSONP interface.
*
* ### Examples