๐
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
| /* TYPESCRIPT */ | |
| import authentication = require('feathers-authentication'); | |
| let authenticate = authentication.hooks.authenticate; | |
| import { OrderQueryParam, SequelizeOrder, filterOrder, filterLikeQueryParam, filterIncludeQueryParam } from '../index'; | |
| const isAuthenticated = authenticate('jwt'); | |
| export default { |
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
| /* TYPESCRIPT */ | |
| import * as path from 'path'; | |
| import * as favicon from 'serve-favicon'; | |
| import * as compress from 'compression'; | |
| import * as cors from 'cors'; | |
| import * as helmet from 'helmet'; | |
| import * as bodyParser from 'body-parser'; | |
| import * as cookieParser from 'cookie-parser'; | |
| import * as feathers from 'feathers'; |
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
| version: 2 | |
| jobs: | |
| build: | |
| docker: | |
| - image: kyleondy/alpine-rsync | |
| working_directory: ~/repo | |
| steps: | |
| - run: | |
| name: list | |
| command: ls -la ~/.ssh |
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
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // Choose either "stable" for receiving highly polished, | |
| // or "canary" for less polished but more frequent updates | |
| updateChannel: 'stable', |
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 { createTransport, SendMailOptions } from 'nodemailer'; | |
| import { IncomingMessage, ServerResponse } from 'http' | |
| import { json, send } from 'micro'; | |
| type MicroFunction = (req: IncomingMessage, res: ServerResponse) => string | void | Promise<any>; | |
| type DorianMailData = { | |
| dest: string, | |
| body: string, |
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 crypto = require('crypto'); | |
| const util = require('util'); | |
| const curry = require('lodash/curry'); | |
| const compose = require('lodash/flowRight'); // alias flowRight as compose | |
| const moment = require('moment'); | |
| const Task = require('folktale/concurrency/task'); | |
| const { fromPromised, waitAll } = require('folktale/concurrency/task'); | |
| // isValidForgotPasswordRequest :: ForgotPasswordInput -> boolean |
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 { curry, flowRight as compose } from 'lodash'; | |
| const Task = require('folktale/concurrency/task'); | |
| /* example code, pieces from application */ | |
| /* Imagine a functional-progrmaming style Forgot Password workflow */ | |
| usernameOrEmailExists = (input: {/*...*/}) => isValid(input) | |
| ? Task.of(input.username) | |
| : Task.rejected('Invalid'); |
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 { curry } from 'lodash'; | |
| export type Predicate = () => boolean; | |
| export type Func<a> = () => a; | |
| export interface ThenElse<T = void, E = T> { | |
| t: Func<T>, | |
| e: Func<E> | |
| } |
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
| class ContinueOnSuccess { | |
| items = []; | |
| length = 0; | |
| constructor(newItems) { | |
| this.items = newItems; | |
| length = this.items.length; | |
| } |
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
| // CLIENT | |
| import feathers from '@feathersjs/feathers' | |
| import socketio from '@feathersjs/socketio-client' | |
| import auth from '@feathersjs/authentication-client' | |
| import io from 'socket.io-client' | |
| const socket = io('http://localhost:3030') | |
| const app = feathers() | |
| // Set up Socket.io client with the socket |