Skip to content

Instantly share code, notes, and snippets.

View DominicGBauer's full-sized avatar

Dominic Gunther Bauer DominicGBauer

View GitHub Profile
// 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
// Use the componentDidMount function to use the
// handlepic function we just created and therefore
// render the picture to the screen
componentDidMount() {
this.handlepic()
}
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({
@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'
)
version:2.1
# 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:
@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,
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 / 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';