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 graphql = require('graphql'); | |
const _ = require('lodash'); | |
const constants = require('../constants'); | |
const { | |
parse, | |
validate, | |
validateSchema, | |
execute, |
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 workerThreads = require('worker_threads'); | |
const rx = require('rxjs'); | |
class Worker { | |
constructor(file, data) { | |
this.messageId = 0; | |
this.callbacks = new Map(); | |
this.client = new workerThreads.Worker(file, { | |
workerData: { | |
id: Date.now(), |
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
"workbench.colorCustomizations": { | |
"[Monokai]": { | |
"activityBar.background": "#17191a", | |
"activityBar.border": "#363738", | |
"badge.background": "#17191a", | |
"editor.background": "#26292e", | |
"editorGroupHeader.tabsBackground": "#17191a", | |
"editorHoverWidget.background": "#17191a", | |
"editorHoverWidget.border": "#363738", | |
"focusBorder": "#00000000", |
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'); | |
const AWS = require('aws-sdk'); | |
const rx = require('rxjs'); | |
const rxop = require('rxjs/operators'); | |
AWS.config.update({ | |
accessKeyId: process.env.ACCESS_KEY_ID, | |
secretAccessKey: process.env.SECRET_ACCESS_KEY, | |
region: process.env.REGION | |
}); |
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"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Patterns.html</title> | |
</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
(async () => { | |
const scripts = new Map([ | |
['app', chrome.runtime.getURL('static/app.js')], | |
['app2', chrome.runtime.getURL('static/app2.js')], | |
['progress', chrome.runtime.getURL('static/progress.js')] | |
]); | |
const p = async (fn, ...args) => { | |
return new Promise((resolve, reject) => { | |
return fn(...[...args, (...response) => { |
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'); | |
const LRU = require('lru-cache'); | |
class Cache { | |
constructor(maxSizeInMB = 128) { | |
this.lru = new LRU({ | |
max: maxSizeInMB * 1e+6, | |
length: n => Buffer.byteLength(n, 'utf8') | |
}); | |
} |
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
export const loadScript = (id, url, test) => new Promise(resolve => { | |
let s = document.getElementById(id); | |
if (!s) { | |
s = document.createElement('script'); | |
s.setAttribute('id', id); | |
s.defer = true; | |
s.src = url; | |
document.body.appendChild(s); | |
} |
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 React, { Component } from 'react'; | |
import { Image, Button, Icon} from 'semantic-ui-react'; | |
import Style from './card1.module.css'; | |
import Photo from '../food.jpg'; | |
class Card1 extends Component { | |
constructor(props) { | |
super(props); | |
const { |
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 Redis = require('ioredis'); | |
const redis = new Redis(); | |
exports.handler = (event, context, callback) => { | |
context.callbackWaitsForEmptyEventLoop = false; | |
redis.pipeline() | |
.set('a', 'b') | |
.get('a') | |
.exec() |