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
/*---------------------------------------------------- | |
@File: Core Styles | |
@Author: Wes Duff | |
Author E-mail: [email protected] | |
This is the core css for your application | |
- fonts | |
- base text sizes for h1-h6 | |
---------------------------------------------------- */ |
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
/** | |
Assumptions | |
- You have a folder in the same space named baseLogger | |
- - You can have other loggers if needed but with this code, you must have a baseLogger | |
Inside baseLogger | |
- should have but not limited to | |
- - debug.log.txt | |
**/ | |
const fileWriter = ((fs) => { |
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
/* Need this so tests will pass */ | |
global.RavenIngestLogger = { | |
error: function(val){ | |
console.log(`mock RavenIngestLogger -> Error : ${JSON.stringify(val)}`); | |
}, | |
debug: function(val){ | |
console.log(`mock RavenIngestLogger -> debug : ${typeof val === 'string' ? val : JSON.stringify(val)}`); | |
}, | |
info: function(val){ | |
console.log(`mock RavenIngestLogger -> info : ${JSON.stringify(val)}`); |
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
class CustomException extends Error { | |
constructor(message, errorCode) { | |
super(message); | |
this.name = 'MyError'; | |
this.code = errorCode || 510; | |
} | |
} | |
class Logger { | |
constructor(error){ | |
this.error = error; |
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
/** | |
* Dynamic Programming example : | |
* break the problems down into individual methods that handle one thing | |
* Put together the solutions from all of the individual methods to come up with the answer. | |
* store | |
* - table bool [][] // storage data structure | |
* - palindrome | |
* - length of pongest palindrome | |
* | |
* methods: sub problems |
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 crypto = require('crypto'); | |
const algorithm = 'aes-256-ctr'; | |
const password = '<your password>'; | |
class CryptoString { | |
static set(text){ | |
const cipher = crypto.createCipher(algorithm, password); | |
let crypted = cipher.update(text, 'utf8', 'hex'); |
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
let logger_instance = null; | |
class Logger { | |
constructor() { | |
} | |
static instance(message, user, serviceError, note, code){ | |
console.log('static instance called'); | |
if(logger_instance === null){ | |
console.log('==== create'); | |
logger_instance = new Logger(); |
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
/* =============== CONSTANTS ============================ */ | |
export const AWS_SIGN_UP_SAVING = 'AWS_SIGNUP_SAVE'; | |
export const AWS_SIGN_UP_FAIL = 'AWS_SIGN_UP_FAIL'; | |
export const AWS_SIGN_UP_SUCCESS = 'AWS_SIGN_UP_SUCCESS'; | |
export const THROW_ERROR = 'THROW_ERROR'; | |
export const CLEAR_ERROR = 'CLEAR_ERROR'; | |
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
using System; | |
public class Program | |
{ | |
public static int GetMissingNumberFromArray(int[] arr) | |
{ | |
Console.WriteLine("======================="); | |
int totalXor = 0; | |
int totalArrXor = 0; |
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 nock from 'nock'; | |
import request from 'superagent'; | |
describe('Calling AWS SDK to sign up a user', () => { | |
let postData = {username: '[email protected]', password: '@Password1'}; | |
let _request = null; | |
beforeEach(() => { | |
nock('http://aws-sdk.aws.com/', { |
NewerOlder