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 from 'react' | |
| import useErrorBoundary from 'use-error-boundary' | |
| import styled from 'styled-components' | |
| import { Remirror, useRemirror, useRemirrorContext } from '@remirror/react' | |
| import { YjsExtension } from '@remirror/extension-yjs' | |
| import { IndexeddbPersistence } from 'y-indexeddb' | |
| import { WebrtcProvider } from 'y-webrtc' | |
| import { WebsocketProvider } from 'y-websocket' | |
| import { Doc } from 'yjs' |
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 * as React from 'react'; | |
| /** | |
| * React.Ref uses the readonly type `React.RefObject` instead of | |
| * `React.MutableRefObject`, We pretty much always assume ref objects are | |
| * mutable (at least when we create them), so this type is a workaround so some | |
| * of the weird mechanics of using refs with TS. | |
| */ | |
| export type AssignableRef<ValueType> = | |
| | { |
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" xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta name="mobile-web-app-capable" content="yes" /> | |
| <meta name="apple-mobile-web-app-capable" content="yes" /> | |
| <title>Starfield</title> | |
| </head> |
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 fs = require('fs'); | |
| const puppeteer = require('puppeteer'); | |
| const GIFEncoder = require('gifencoder'); | |
| const PNG = require('png-js'); | |
| function decode(png) { | |
| return new Promise(r => {png.decode(pixels => r(pixels))}); | |
| } |
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
| /* global chrome, MediaRecorder, FileReader */ | |
| chrome.runtime.onConnect.addListener(port => { | |
| let recorder = null | |
| port.onMessage.addListener(msg => { | |
| console.log(msg); | |
| switch (msg.type) { | |
| case 'REC_STOP': | |
| console.log('Stopping recording') | |
| if (!port.recorderPlaying || !recorder) { |
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 { ApolloLink } from 'apollo-link' | |
| const createTokenLink = ({ getToken }) => | |
| new ApolloLink((operation, forward) => { | |
| const token = getToken() | |
| if (token) | |
| operation.setContext({ | |
| headers: { | |
| authorization: `Bearer ${token}` | |
| } |
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
| #!/usr/bin/env node | |
| var argv = require('optimist') | |
| .usage('Usage: --key=[consumer key] -secret=[consumer secret]') | |
| .demand(['key', 'secret']) | |
| .argv | |
| ; | |
| var OAuth = require('oauth').OAuth; | |
| var Step = require('step'); |
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 functions = require('firebase-functions'); | |
| const gcs = require('@google-cloud/storage')(); | |
| const sharp = require('sharp') | |
| const _ = require('lodash'); | |
| const path = require('path'); | |
| const os = require('os'); | |
| exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => { | |
| const object = event.data; // The Storage object. |
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 { introspectSchema } = require("apollo-codegen"); | |
| const { executeWithOptions } = require("graphql-code-generator/dist/cli"); | |
| const fs = require("fs"); | |
| const path = require("path"); | |
| const graphqlPath = "./src/graphql/"; | |
| const schemaInput = "./src/graphql/temp.graphql"; | |
| const jsonOutput = "./src/graphql/temp.json"; | |
| const dtsOutput = "./src/graphql/domain.d.ts"; |
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
| app.post('/login', function(req, res) { | |
| console.log(res); | |
| passport.authenticate('local', function(err, user) { | |
| if (req.xhr) { | |
| //thanks @jkevinburton | |
| if (err) { return res.json({ error: err.message }); } | |
| if (!user) { return res.json({error : "Invalid Login"}); } | |
| req.login(user, {}, function(err) { | |
| if (err) { return res.json({error:err}); } | |
| return res.json( |
NewerOlder