A bracket in file name is actually represent directory
This file contains 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 test from 'ava' | |
import axios from 'axios' | |
import axiosMocker from './axios-mock' | |
import { externalAPI } from '../../services' | |
import qs from 'query-string' | |
const { addMock, enableMocking } = axiosMocker(externalAPI.request) | |
enableMocking(true) | |
test.serial('test getAccessToken', async t => { |
This file contains 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 { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios' | |
export class ResourcesRestClient { | |
private instance: AxiosInstance | |
private config?: AxiosRequestConfig | |
constructor(client: AxiosInstance, config?: AxiosRequestConfig) { | |
this.instance = client | |
this.config = config |
This file contains 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
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
This file contains 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
/** | |
* Created by Muhammad Faizan on 7/12/2017. | |
*/ | |
const ErrorFactory = (name, code) => class CustomError extends Error { | |
/** | |
* | |
* @param {Error|String} error | |
* @param {Object} options | |
* @param {String} options.errorCode |
This file contains 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
require('dotenv').config() | |
const { MongoClient, ObjectID } = require('mongodb') | |
const url = process.env.MASTER_DB_URI | |
const documents = require('./data.json') | |
const connect = dbUrl => new Promise((resolve, reject) => { | |
MongoClient.connect(dbUrl, (err, db) => { | |
if (err) reject(err) | |
else resolve(db) |
This file contains 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 mongoose = require('mongoose') | |
const RK = mongoose.Schema.ObjectId | |
module.exports = class BaseSchema extends mongoose.Schema { | |
constructor (schema) { | |
const updater = { | |
created: { | |
by: { type: String}, | |
user: { type: RK, ref: 'User', select: false }, |
In this talk, Mashhood share how we can configure "git push deployments". Using Git and EC2 we can quickly configure a deployment for our selves with minimal efforts. Then he also shares the deployment for S3 alongside this. Watch it on Youtube
- Create EC2 instance.
- Configure SSH alias
- Setup the instance
This file contains 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
<script type="text/javascript"> | |
(function() { | |
var appPath = '{{{appPath}}}'; | |
var pageType = { | |
CART: '/cart/', | |
PRODUCT: '/d/', | |
CATALOG: '/c/', | |
WISHLIST: '/w/', | |
LOGIN: '/l/', | |
REGISTER: '/r/', |
This file contains 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
function resetSeller(box, oldbox) { | |
var iconClassName = '.expander.class.name'; | |
if (box === null) { | |
box = oldbox.parentElement; | |
console.log(box); | |
} | |
var expander = box.querySelector(iconClassName); | |
if (expander) { | |
expander.click(); | |
setTimeout(() => { |
NewerOlder