Skip to content

Instantly share code, notes, and snippets.

View robertbenjamin's full-sized avatar
🧀
cheese

Robert Benjamin robertbenjamin

🧀
cheese
View GitHub Profile
@robertbenjamin
robertbenjamin / parse-and-map-report.md
Created March 31, 2020 17:21
Parse and Map Report

Prompt

Write a function that accepts an API response formatted as a JSON string. This function should parse, validate, and map the response JSON based on the following specifications.

Validation of the response should be checked using the value of Response.Status. If the Status value is not 'Success', then an error should be thrown. A reason string for the response failure can be found at Response.Reason and should be included with the thrown error's mesasge.

If the response is considered successful, map the result to the following object specification:

  • report: The base object containing the report
  • report.personal: A collection of personal information
@robertbenjamin
robertbenjamin / tap-harvest-forecast-connection-test-logs
Created August 22, 2018 00:21
Logs from testing the connection of the Harvest Forecast tap.
2018-08-22 00:20:22,706Z main - INFO Running tap-harvest-forecast version 0.0.1 and target-stitch version 1.7.4
2018-08-22 00:20:22,831Z main - INFO Starting tap to discover schemas: tap-env/bin/tap-harvest-forecast --config /tmp/tap_discover_config.json --discover
2018-08-22 00:20:22,985Z tap - INFO Starting sync
2018-08-22 00:20:22,985Z tap - INFO GET https://api.forecastapp.com/assignments
2018-08-22 00:20:24,622Z tap - INFO GET https://api.forecastapp.com/clients
2018-08-22 00:20:24,717Z tap - INFO GET https://api.forecastapp.com/milestones
2018-08-22 00:20:24,818Z tap - INFO GET https://api.forecastapp.com/people
2018-08-22 00:20:24,933Z tap - WARNING Removed 1 paths during transforms:
2018-08-22 00:20:24,933Z tap - personal_feed_token_id
2018-08-22 00:20:24,933Z tap - WARNING Removed paths list: ['personal_feed_token_id']
@robertbenjamin
robertbenjamin / keybase.md
Created July 27, 2018 19:34
My Keybase verification for Github.

Keybase proof

I hereby claim:

  • I am robertbenjamin on github.
  • I am robertbenjamin (https://keybase.io/robertbenjamin) on keybase.
  • I have a public key whose fingerprint is 45F0 2B54 DA22 3109 64BE A1C3 2931 727E BCC9 20D8

To claim this, I am signing this object:

@robertbenjamin
robertbenjamin / harvest-forecast-documentation.md
Created July 19, 2018 23:52
Documentation for the Harvest Forecast Tap.

Harvest Forecast

Connecting Harvest Forecast

Requirements

To set up this Harvest Forecast in Stitch, you need to create a personal access token in the developer tools section of Harvest's website.

Setup

@robertbenjamin
robertbenjamin / booklist.md
Created January 4, 2018 17:27
My book list

Books

Most recent books at the bottom of each respective list. Divided by when they were started and finished.

Read

Finished in 2017

  • The Pragmatic Programmer - Andrew Hunt & David Thomas
@robertbenjamin
robertbenjamin / booklist.md
Created December 5, 2017 23:07
Book List

Books

Most recent books at the bottom of each respective list. Divided by when they were started and finished.

Read

Finished in 2017

  • The Pragmatic Programmer - Andrew Hunt & David Thomas
@robertbenjamin
robertbenjamin / interests.md
Last active November 25, 2017 21:39
How do I spend my time?

Some pros and cons of different ways to spend my time:

Japanese

Pros

  • Increase my ability to converse with Japanese people.
  • Increase my ability to read and consume Japanese media. Japan has a fascinating history and a lot of the books, tv shows, and movies made in Japan are totally unique and unlike anything else in the world.
  • If I move to Japan (or even visit again for a longer period of time), I will be better prepared to improve quickly. This is especially true if I improve reading and texting.
  • Set myself up for learning more languages down the line. I want to learn Spanish next, especially if I visit or spend time in Mexico or South America, and continuing to learn Japanese to a deeper degree would help me understand how to progress through the intermediate stages of learning a language. My case is a bit unusual since I learned Japanese as a kid then forgot most of it, but Japanese is still one of the hardest languages for English speakers and getting to a high level with it would mean many
@robertbenjamin
robertbenjamin / credit.c
Created July 31, 2017 03:57
Validate a credit card using the Luhn formula.
#include <stdio.h>
#include <cs50.h>
#include <math.h>
long get_number();
int get_number_length(long number);
int get_sum_of_digits(long number);
long get_first_n_digits(long number, int n);
bool validate_number(long number, long number_length);

What Does the “Death of the Homepage” Really Mean?

In the last year, dozens of publications (such as The Atlantic, Fast Company, and Poynter) have reported on the so-called “Death of the Homepage.” These publications are refering to the steadily declining levels of web traffic to the homepages of a number of large, traditional news outlets such as The New York Times.

They typically focus on the shift to personalized content and the increased importance of social media reference for traffic — but I believe making that the focus is missing the point.

In reality, the phrase "death of the homepage" doesn't purport to mean that homepages no longer matter. Rather, it indicates that in m

import java.util.*;
public class removeZeros {
public static void main(String[] args) {
int[] list = {7, 2, 3, 0, 4, 6, 0, 0, 13, 0, 78, 0, 0, 19, 14};
removeZeroes(list);
System.out.println(Arrays.toString(list));
}
public static void removeZeroes(int[] list) {