Skip to content

Instantly share code, notes, and snippets.

const initialState = {
1: {
todos: [],
visibilityFilter: 'SHOW_ALL'
},
2: {
todos: [],
visibilityFilter: 'SHOW_ALL'
},
3: {
function* countdown() {
yield call(delay, toMilliseconds(480));
yield put(showLogoutWarning());
yield call(delay, toMilliseconds(120));
yield put(logout());
}
function* watchForActivity() {
while (true) {
yield takeLatest(action => action.type !== ' SHOW_LOGOUT_WARNING', countdown);
const Client = require('./Client')
const StatusSocket = require('./Socket')
/**
* Upload files to Transloadit using Tus.
*/
module.exports = class Transloadit extends EventEmitter {
constructor (core, opts) {
super(core, opts)
this.type = 'uploader'
.container {
margin-left: auto;
margin-right: auto;
padding-left: 15px;
padding-right: 15px;
}
.container::after {
content: "";
display: table;
clear: both;
@hedgerh
hedgerh / cross-browser.md
Last active April 6, 2017 18:05
How to add easy cross-browser testing to your existing project

Here's an easy way to add easy cross-browser testing on your existing projects using browser-sync

1. install browser-sync

npm i browser-sync --save-dev

2. add an npm script to your package.json

"test:browser": "browser-sync start --config ./bs-config.js"

import HSStageScene from './hs_stage_scene';
class HSStageObject {
viewProps(): HSViewProps {
return {
stageHeight: HSStageScene.stageHeight
};
}
}

Uppy Server is the server side component for Uppy. It is currently built with the Koa framework for Node.js.
The purpose of Uppy Server is to interface with third party APIs and handle remote file uploading from them.

How it works

oAuth with Grant, Sessions

Uppy Server uses an oAuth middleware library called Grant to simplify oAuth authentication. Inside of config/grant.js, you configure the oAuth providers you wish to use, providing things like client key, client secret, scopes, and the callback URL you wish to use. For example:

var openpgp = require('openpgp'); // use as CommonJS
var path = require('path');
//var __dirname = '/home/evan/Documents/jeff/node/jb';
var worker_path = path.join(__dirname, 'node_modules', 'openpgp','worker', 'worker.js');
openpgp.initWorker({ path: worker_path }); // set the relative web worker path
openpgp.config.aead_protect = true; // activate fast AES-GCM mode (not yet OpenPGP standard)
var fs = require('fs');
React Native CLI commands:
# overview
/**
* Used arguments:
* -v --version - to print current version of react-native-cli and react-native dependency
* if you are in a RN app folder
* init - to create a new project and npm install it
* --verbose - to print logs while init
* --version <alternative react-native package> - override default (https://registry.npmjs.org/react-native@latest),
loadVideoById("bHQqvYy5KYo", 5, "large")