This file contains 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 createWorker(fn) { | |
// Create a Blob object that contains the code for the worker | |
// create wrapper function that calls the function passed to createWorker | |
// and then posts the result back to the main thread | |
const fnStr = fn.toString() | |
// wrap the function in a function that calls the function and posts the result | |
const wrapper = `async function(evt) { | |
const fn = ${fnStr} |
This file contains 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
type Iteraterable = { | |
next: () => { value?: any; key?: any; hasNext: boolean; done: () => void } | |
hasNext: () => boolean | |
} | |
const clone = (obj: any) => JSON.parse(JSON.stringify(obj)) | |
const makeArrayIterator = (array: any[]): Iteraterable => { | |
array = clone(array) | |
let nextIndex = 0 |
This file contains 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" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Test</title> | |
<script src="https://unpkg.com/vue@next"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" /> | |
</head> |
This file contains 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
class Client { | |
static _instance | |
static defaultHeaders = { 'Content-Type': 'application/json' } | |
config = { | |
baseUrl: '', | |
urlHandler: (baseUrl, uri, query) => { | |
var url = `${baseUrl}${uri}` | |
if (uri.includes('://')) { | |
url = uri |
This file contains 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
package transform | |
import ( | |
"reflect" | |
"strings" | |
"time" | |
) | |
const ( | |
tagName = "firestore" |
This file contains 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
{"lastUpload":"2021-03-08T22:25:42.938Z","extensionVersion":"v3.4.3"} |
This file contains 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 'dart:async'; | |
class ServiceRespository { | |
Future<String> authenticate(String username, String password) { | |
if(username == "admin" && password == "admin") { | |
return Future<String>.delayed(Duration(milliseconds: 2000)) | |
.then((_) => "abc"); | |
} | |
return Future<String>.delayed(Duration(milliseconds: 1000)) | |
.then((_) => throw "invalid credentials"); |
This file contains 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 'dart:async'; | |
enum CounterEvent {increment, decrement} | |
class CounterBloc { | |
int _counter = 0; | |
get state => _counter; | |
final _counterStateController = StreamController<int>(); |
This file contains 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
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"github.com/arangodb/go-driver" | |
"github.com/arangodb/go-driver/http" | |
"log" | |
"strings" |
This file contains 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 { append } = orango.funcs | |
orango.builder() | |
.add('numbers', append([1, 2, 3], [3, 4, 5], true)) | |
.add('email', '[email protected]') | |
.add('users', User.find().where({email: "@email"}) | |
.return({ | |
}) | |
NewerOlder