This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here's a generic transformer helper function | |
const transform = (function(EMPTY) { | |
const transform = function*(iterable, trasformers) { | |
for (let res of iterable) { | |
for (let i = 0; i < trasformers.length && res !== EMPTY; i++) { | |
res = trasformers[i](res); | |
}; | |
if (res !== EMPTY) yield res; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function repeatPromise(func, attempts = 10, delay = 1000) { | |
let attemptNumber = 0; | |
return (function internalTry() { | |
attemptNumber++; | |
if (attemptNumber > attempts) { | |
return Promise.reject('Number of attempts exceeded'); | |
} else { | |
return func().catch(() => new Promise((resolve) => setTimeout(resolve, delay)).then(internalTry)); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
_ = require('lodash'), | |
kefir = require('kefir'), | |
request = require('request'), | |
url = require('url'), | |
express = require('express'); | |
let videoSourcesProperty = kefir | |
.combine([ | |
"https://player.vimeo.com/external/217157675.m3u8?s=4a0c6e0d89f1d443259dc8848866a8b7262ac31e", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="https://unpkg.com/[email protected]/dist/kefir.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/lodash.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/umd/react.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
_ = require('lodash'), | |
kefir = require('kefir'), | |
net = require('net'), | |
https = require('https'), | |
bigInt = require('big-integer'), | |
{ createHash } = require('crypto'); | |
const | |
LOGGLY_API_KEY = "b8d2377d-63d8-4f4c-ae07-fb05bb999b3c", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fetch } from 'wix-fetch'; | |
const requireAMD = function (url) { | |
return fetch(url) | |
.then((res) => res.text()) | |
.then((code) => { | |
return new Promise((resolve, reject) => { | |
(new Function("define", code))( | |
(function () { | |
let define = (...args) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kefir.min.js"></script> | |
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kefir.min.js"></script> | |
</head> | |
<body> | |
<script> | |
Kefir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createCustomElement = function(generator, attributes = []){ | |
const | |
BUS = Symbol('bus'), | |
Element = class extends HTMLElement { | |
constructor(props) { | |
super(props); | |
const | |
instance = Reflect.construct(HTMLElement, [], this.constructor), | |
emitter = (function(){ | |
const eventMap = new Map(); |
OlderNewer