Skip to content

Instantly share code, notes, and snippets.

View DominicGBauer's full-sized avatar

Dominic Gunther Bauer DominicGBauer

View GitHub Profile
@DominicGBauer
DominicGBauer / example.js
Created October 11, 2023 05:13
Example for Job Application
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as dayjs from 'dayjs';
import * as mongoose from 'mongoose';
import { set } from 'lodash';
import * as sut from './paymentProviderSettlements.rules';
import * as model from './paymentProviderSettlements.models';
import * as paymentRules from '../../models/payments.rules';
import { IPayments } from '../../models/payments.types';
import { IPaymentProviderSettlements } from './paymentProviderSettlements.types';
Object.keys(data).sort().map((item, key) => {
const grouped = {};
data[item].map(item => {
if (typeof grouped[item.type] === 'undefined') {
grouped[item.type] = {
name: item.type,
members: [item]
};
}
else {
@DominicGBauer
DominicGBauer / namedfunction.js
Created July 7, 2020 13:48
variabeNamesSaveLives
Object.keys(productionDays)
.sort()
.map((productionDay) => {
const groupCastMembersByRoleType = {}
productionDays[productionDay].map((castMember) => {
if (
typeof groupCastMembersByRoleType[castMember.type] === 'undefined'
) {
groupCastMembersByRoleType[castMember.type] = {
roleType: castMember.type,
# This code is licensed from CircleCI to the user under the MIT license. See
# https://circleci.com/orbs/registry/licensing for details.
version: 2.1
description: |
A set of tools for working with Amazon S3. Requirements: bash
Source: https://github.com/circleci-public/circleci-orbs
examples:
basic_commands:
version:2.1
@DominicGBauer
DominicGBauer / webdriver-example.js
Last active September 2, 2019 11:54
webdriver example
it('should slide through gallery', async () => {
const gallery = await browser.$('.open-gallery-button')
await gallery.click()
await delay(2000)
const rightSwipe = await browser.$('.right-arrow')
await rightSwipe.click()
await delay(2000)
const paragraph = await browser.$$(
'div:nth-of-type(3) .caption-drawer .post-content p'
)
// Use the componentDidMount function to use the
// handlepic function we just created and therefore
// render the picture to the screen
componentDidMount() {
this.handlepic()
}
// We're creating a function to handle retrieving
// the image from the NASA API
// Function is asynchronous because talking to the API
// isn't instantaneous (your bartender can't instantly
// give you your drink when you ask him for it)
handlePic = async () => {
// Create a response variable that retrieves the data
const response = await nasa.get()
// Change the state of picture to be the hdurl
{
"date": "2019-02-10",
"explanation": "What does Venus look like beneath its thick clouds? These clouds keep the planet's surface hidden from even the powerful telescopic eyes of Earth-bound astronomers. In the early 1990s, though, using imaging radar, NASA's Venus-orbiting Magellan spacecraft was able to lift the veil from the face of Venus and produced spectacular high resolution images of the planet's surface. Colors used in this computer generated picture of Magellan radar data are based on color images from the surface of Venus transmitted by the Soviet Venera 13 and 14 landers. The bright area running roughly across the middle represents the largest highland region of Venus known as Aphrodite Terra. Venus, on the left, is about the same size as our Earth, shown to the right for comparison.",
"hdurl": "https://apod.nasa.gov/apod/image/1902/VenusEarth_MagellanApollo17_3000.jpg",
"media_type": "image",
"service_version": "v1",
"title": "Venus Unveiled",
"url": "https://apod.nasa.gov/apod/image/1902/Ve
import axios from 'axios'
// Create a KEY variable for the NASA API key you received earlier
// Make sure it's in quotations
const KEY = 'YOUR KEY'
// Create a nasa variable that we will use to perform our API request
// Axios is going to create a url for us that conforms to NASA's
// specifications
let nasa = axios.create({