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
// Implement a key-value store with get(key), put(key, value), delete(key) operations. | |
class CustomMap { | |
constructor() { | |
this._keys = []; | |
this._values = []; | |
}; | |
put(key,value) { | |
this._keys.push(key) |
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 validatePerson(fistName, result, lastName, email) { | |
if (!fistName) { | |
result = false | |
} | |
if (!lastName) { | |
result = false | |
} | |
if (email.match(/^[a-zAZ.]{1,64}@[a-zA-Z.]{1,64}$/) == null) { |
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 MAX_VALUE = 1048575 | |
const integerOperation = (integer) => (stack) => { | |
stack.push(parseInt(integer)) | |
} | |
const popOperation = (stack) => { | |
stack.pop() | |
} |
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 isEven = (num) => (num % 2 === 0) | |
const getNumber = (array = []) => { | |
const size = array.length | |
if(isEven(size)){ | |
const index = size/2 | |
return (array[index]+array[index-1])/2 | |
} | |
const index = (size-1)/2 | |
return array[index] |
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 SearchingChallenge(str) { | |
let arrayString = str.split("") | |
let reversedArrayString = str.split("").reverse() | |
let reversedString = reversedArrayString.join("") | |
let result = '' | |
let hasNext = true | |
let i = 0 | |
while(hasNext){ | |
for(let j = i + 1 ; j<= arrayString.length ; j ++){ |
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 { gql } from 'apollo-server-express' | |
import { GraphQLError } from 'graphql/error' | |
import { Kind } from 'graphql/language' | |
const EMAIL_REGEX = new RegExp( | |
/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/ | |
) | |
const Email = gql` | |
"Scalar data representing email" |
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
virtualenv -p /usr/bin/python3.6 venv ou python3 -m venv ./venv | |
source venv/bin/activate |
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
hostname -A | |
hostnamectl set-hostname | |
ping $(hostname -f) |
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 Aggregator: | |
def __init__(self, *initial_data): | |
for dictionary in initial_data: | |
for key in dictionary: | |
setattr(self, key, dictionary[key]) |
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
FROM outofcoffee/imposter-openapi |
NewerOlder