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 express = require('express'); | |
| const morgan = require("morgan"); | |
| const cors = require('cors'); | |
| const { createProxyMiddleware } = require('http-proxy-middleware'); | |
| // Create Express Server | |
| const app = express(); | |
| // cors | |
| app.use(cors()) |
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 { format } from 'url'; | |
| import { STATUS_CODES } from 'http'; | |
| import uppercamelcase from 'uppercamelcase'; | |
| class HTTPError extends Error { | |
| constructor(code, message, extras) { | |
| super(message || STATUS_CODES[code]); | |
| if (arguments.length >= 3 && extras) { | |
| Object.assign(this, extras); | |
| } |
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
| ssh-add -K ~/.ssh/NEW_rsa |
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 { group, sleep } from 'k6'; | |
| import http from 'k6/http'; | |
| // Version: 1.3 | |
| // Creator: Load Impact URL test analyzer | |
| export let options = { | |
| stages: [ | |
| { | |
| "duration": "24s", |
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
| export class G964 { | |
| public static findNb(m: number): number { | |
| // create an endless loop that increments n, the cube number, starting with a value of 1 | |
| for ( var n = 0;;n++ ) { | |
| if ( m > 0 ) { | |
| // if m, the total volume, is not 0, we will subtract the volume of the current cube from it | |
| // first calculate the volume of the current cube | |
| let currCubeVol = Math.pow( n+1, 3); | |
| // subtract the current cube volume from the total volume |
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
| export class Kata { | |
| static disemvowel(str: string) { | |
| return str.replace(new RegExp('[AEIOUaeiou]', 'g'), ''); | |
| } | |
| } |
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
| /* | |
| Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of strings of a2. | |
| #Example 1: a1 = ["arp", "live", "strong"] | |
| a2 = ["lively", "alive", "harp", "sharp", "armstrong"] | |
| returns ["arp", "live", "strong"] | |
| #Example 2: a1 = ["tarp", "mice", "bull"] |
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 SmallestIntegerFinder { | |
| findSmallestInt(args) { | |
| return args.sort(function(a, b) { | |
| return a - b; | |
| })[0]; | |
| } | |
| } | |
| //test | |
| Test.describe("Smallest Integer Tests", _ => { |
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
| function solution(maxN){ | |
| let numbers=[3,5]; | |
| let passingNs = []; | |
| let ret = 0; | |
| for (let i = 1; i < maxN; i++) { | |
| numbers.forEach(n => { | |
| if (i * n < maxN && passingNs.indexOf((i*n)) === -1) { | |
| passingNs.push(i*n); | |
| } | |
| }); |
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
| // Heron's Formula | |
| function isTriangle(a,b,c) | |
| { | |
| return (a < (b + c)) && ((a + b) > c) && ((a+c) > b); | |
| } | |
| isTriangle(1,2,2) // => true | |
| isTriangle(7,2,2) // => false | |
| isTriangle(1,2,5) // => false | |
| isTriangle(4,2,3) // => true |
NewerOlder