Skip to content

Instantly share code, notes, and snippets.

View bogdanned's full-sized avatar
🎯
Focusing

Bogdan Nedelcu bogdanned

🎯
Focusing
View GitHub Profile
@bogdanned
bogdanned / recusive-selection-sort.js
Created May 30, 2022 07:33
Recursive Selection Sort
// 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
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
/// <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", () => {
function test(){
return 34
}
@bogdanned
bogdanned / query.spec.js
Created October 4, 2021 09:15
Testing A GraphQL Query
const supertest = require("supertest");
let movie_list_query = `{
movies {
id
name
actors {
name
age
id
// Simplified structure of the type map
let typeMap = {
rootType: {
fields: { // array with the fields of the root ype
user: {
type: {
fields: {
lastname: {...},
settings: {...},
}
@bogdanned
bogdanned / math.js
Created February 16, 2020 18:56
math
module.exports.default = function sum(a,b){return a + b}
{
id: project.id,
name: project.name,
elements: project.elements
[key]: value
}
//v.s.
{