View recusive-selection-sort.js
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 Selection Sort | |
// The algorithm divides the input list into two parts: | |
// - a sorted sublist of items which is built up from left to right at the front (left) of the list | |
// - a sublist of the remaining unsorted items that occupy the rest of the list. | |
// Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. | |
// The algorithm proceeds by: | |
// - finding the smallest element in the unsorted sublist | |
// - exchanging (swapping) it with the leftmost unsorted element | |
// - moving the sublist boundaries one element to the right. | |
// Read more: https://en.wikipedia.org/wiki/Selection_sort |
View gitlab_job_template.yaml
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
image: node:16 | |
stages: ["build", "test", "staging", "deploy"] | |
# WARNING | |
# This pipeline needs the following variables set up to work: | |
# INSTANCE_IP = // the public IP of the AWS instance | |
# SECRET_KEY = // the secret key to connect to the AWS instance (.pem) file | |
# ENV_FILE = // the .env file for production | |
# the build job |
View calculator.spec.js
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
/// <reference types="cypress" /> | |
// Welcome to Cypress! | |
// To learn more about how Cypress works and | |
// what makes it such an awesome testing tool, | |
// please read our getting started guide: | |
// https://on.cypress.io/introduction-to-cypress | |
describe("The Calculator", () => { |
View test.js
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 test(){ | |
return 34 | |
} |
View query.spec.js
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 supertest = require("supertest"); | |
let movie_list_query = `{ | |
movies { | |
id | |
name | |
actors { | |
name | |
age | |
id |
View typeMap.js
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
// Simplified structure of the type map | |
let typeMap = { | |
rootType: { | |
fields: { // array with the fields of the root ype | |
user: { | |
type: { | |
fields: { | |
lastname: {...}, | |
settings: {...}, | |
} |
View math.js
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
module.exports.default = function sum(a,b){return a + b} |
View deconstruct.js
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
{ | |
id: project.id, | |
name: project.name, | |
elements: project.elements | |
[key]: value | |
} | |
//v.s. | |
{ |