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
| /* eslint consistent-return:0 */ | |
| // const express = require('express'); | |
| const logger = require('./logger'); | |
| const dotenv = require('dotenv'); | |
| const argv = require('./argv'); | |
| const port = require('./port'); | |
| const setup = require('./middlewares/frontendMiddleware'); | |
| const isDev = process.env.NODE_ENV !== 'production'; |
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 CustomVerifier extends Verifier { | |
| // The verify function has the exact same inputs and | |
| // return values as a vanilla passport strategy | |
| verify(req, accessToken, refreshToken, profile, done) { | |
| // do your custom stuff. You can call internal Verifier methods | |
| // and reference this.app and this.options. This method must be implemented. | |
| console.log("===CustomVerifier done, this.app, profile,", done, this.app, profile) | |
| // the 'user' variable can be any truthy value | |
| // the 'payload' is the payload for the JWT access token that is generated after successful authentication | |
| done(null, user, payload); |
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 | |
| const GET_RECORDINGS = gql`{ | |
| recordings { | |
| id | |
| title | |
| input | |
| } | |
| }` | |
| const ADD_RECORDINGS = gql` | |
| mutation($title: String!, $input: AudioInput! ) { |
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 uniqBy from 'lodash'; | |
| /* | |
| * SpotifyPage Actions | |
| * | |
| * Actions change things in your application | |
| * Since this boilerplate uses a uni-directional data flow, specifically redux, | |
| * we have these actions which are the only way your application interacts with | |
| * your application state. This guarantees that your state is up to date and nobody | |
| * messes it up weirdly somewhere. | |
| * |
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
| /* | |
| * HomeReducer | |
| * | |
| * The reducer takes care of our data. Using actions, we can change our | |
| * application state. | |
| * To add a new action, add it to the switch statement in the reducer function | |
| * | |
| * Example: | |
| * case YOUR_ACTION_CONSTANT: | |
| * return state.set('yourStateVariable', true); |
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
| /** | |
| * Gets the repositories of the user from Github | |
| */ | |
| import { delay } from 'redux-saga' | |
| import { call, take, put, select, takeLatest, takeEvery } from 'redux-saga/effects'; | |
| // import { LOAD_REPOS, GET_LISTS, GET_LISTS_SUCCESS, GET_COMMENTS, GET_COMMENTS_SUCCESS, DELETE_COMMENTS, SEARCH_LISTS } from 'containers/App/constants'; | |
| import { fetchAlbumsSuccess, fetchAlbumsError, fetchArtistsError, fetchArtistSongsSuccess, fetchArtistSongsError, fetchCategoriesSuccess, fetchCategoriesError, fetchNewReleasesSuccess, fetchNewReleasesError, fetchFeaturedSuccess, fetchFeaturedError, fetchPlaylistMenuSuccess, fetchPlaylistMenuError, fetchPlaylistSongsError, fetchPlaylistSongsSuccess, fetchSongsError, fetchSongsSuccess, setArtistIds, searchSongsSuccess, fetchRecentlyPlayedPending, fetchRecentlyPlayedError, fetchUserError, fetchUserSuccess, addSongToLibraryError, addSongToLibrarySuccess } from './actions'; | |
| import faker from 'faker'; | |
| import axios from 'axios'; |
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
| /* | |
| * HomeReducer | |
| * | |
| * The reducer takes care of our data. Using actions, we can change our | |
| * application state. | |
| * To add a new action, add it to the switch statement in the reducer function | |
| * | |
| * Example: | |
| * case YOUR_ACTION_CONSTANT: | |
| * return state.set('yourStateVariable', true); |
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 uniqBy from 'lodash'; | |
| /* | |
| * SpotifyPage Actions | |
| * | |
| * Actions change things in your application | |
| * Since this boilerplate uses a uni-directional data flow, specifically redux, | |
| * we have these actions which are the only way your application interacts with | |
| * your application state. This guarantees that your state is up to date and nobody | |
| * messes it up weirdly somewhere. | |
| * |
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
| module.exports = { | |
| valueAtBit: function(num, bit) { | |
| return (num).toString(2) & (bit).toString(2) | |
| }, | |
| base10: function(str) { | |
| return (str).toString(2) | |
| }, | |
| convertToBinary: function(num) { |