Skip to content

Instantly share code, notes, and snippets.

View jsbonso's full-sized avatar
🎯
portal.tutorialsdojo.com

Jon Bonso jsbonso

🎯
portal.tutorialsdojo.com
View GitHub Profile
@jsbonso
jsbonso / gist:fe22ba159acfef6a1dad6fc65129866b
Created May 13, 2019 09:33
Transfer data to and from EC2 using SCP
Transfer Data TO EC2
scp -i ~/.ssh/<your pem keyname>.pem <data to transfer> ec2-user@<IP Address>:<desired folder>/<data to transfer>
scp -i ~/.ssh/ec2.pem users.json [email protected]:app/users.json
Transfer Data FROM EC2 (Take note that there is a dot (.) on the end)
scp -i ~/.ssh/ec2.pem [email protected]:app/users.txt .
@jsbonso
jsbonso / gist:c27814a1f7670ca64fd65e5b1a7a0f6e
Created February 14, 2019 02:59
Curated list of AWS resources to help you pass your AWS Certifications
aws.training
@jsbonso
jsbonso / AWS Certified Solutions Architect-Professional SAP-C01 New Feb 2019 Version Exam Notes.txt
Last active November 18, 2022 05:17
AWS Certified Solutions Architect-Professional SAP-C01 New Feb 2019 Version Exam Notes
# AWS Certified Solutions Architect-Professional SAP-C01 New Feb 2019 Version Exam
## Final Tips:
1. Don't cram! If you are not ready to take the SAP-C01 exam, then just re-schedule it to a later date. Haste makes waste!
2. Read the question first and then look at the options. Most of the time, you will notice that there are two seemingly similar options which only differs in one or several keywords. This will help you eliminate the wrong options much easier.
3. Take the free AWS Exam Readiness course in https://aws.training and other free courses/videos there.
## Exam Notes:
- The new exam has *75* questions that you have to finish within *3* hours (180 minutes) with a minimum passing score of 750 out of 1000. The official AWS exam page says the exam is 170 minutes, but that is actually incorrect. I took the exam and it is 180 minutes and not 170 minutes.
Write a method that finds k-th most common element in a list. For example, kthMostCommon(new in[]{5, 4, 3, 2, 1, 5, 4, 3, 2, 5, 4, 3, 5, 4, 5},2) should return 4. In the array, element 1 occurs once, 2 twice, 3 three times, 4 fours times, and 5 five times, making element 5 the most common element in the list and 4th the second most common element,
@jsbonso
jsbonso / index.html
Created June 6, 2018 19:35
Simple Checkout with Price Rules App using Vanilla JavaScript
<!DOCTYPE html>
<html>
<body>
<h1>Simple Checkout with Price Rules</h1>
<div style="padding-bottom: 25px;">
<h3>Test Case 1: 3 CARI Products</h3>
<p>SKUs Scanned: <code>cari, cari, cari, peti </code></p>
<p>Total expected: $249.00</p>
@jsbonso
jsbonso / custombinarysearch.java
Created June 3, 2018 22:05
Linear Search vs Binary Search Example (Based on time processing)
import java.util.Arrays;
public class BinarySearch {
/**
* Implementation of a Binary Search Returns -1 if no match found
*
* @param sortedArray
* @param target
@jsbonso
jsbonso / Get1stAndLastOccurenceOfANumberInAnArray.java
Created June 3, 2018 22:04
Get 1st and Last Occurence of an element in an Array
String nums = "1 2 3 3 3 3 4 5 6 7 8 9 10";
int target = 3;
String[] numsArray = nums.split(" ");
int firstIndex = 0;
int lastIndex = 0;
boolean firstIndexDone = false;
@jsbonso
jsbonso / VoteCount.java
Last active September 20, 2022 11:19
Counts the number of votes for each Candidates and shows the winner
import java.util.*;
import java.util.concurrent.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
public class VoteCount{
public static void main(String[] args) {
// Populate Data
String[] votes = {"Jon", "Bonso", "Stacey", "Jon", "Bonso", "Stacey", "Jon", "Bonso", "Brie", "Jon", "Bonso", "Jon"};
@jsbonso
jsbonso / gist:6d907ebfdd6915459487839b5f72ad79
Created May 23, 2018 11:27
JavaScript and CSS Reviewer
1. What's the difference between a DIV and SPAN?
- Span is in-line level and div is block level.
2. How to include the padding and border in an element's total width and height in CSS?
- Use Box Sizing: https://www.w3schools.com/css/css3_box-sizing.asp
3. How to create 2 equal DIVs?
4. How to change the second <li> of the list to red color?
@jsbonso
jsbonso / Factorial.java
Last active January 16, 2021 22:14
Factorial Code Example
/*
* Factorial
*
* 1. Get all factors (1, 2, 3 ... n) of a given number (n).
*. 2. Multiply all factors to get the value of the Factorial.
*
* Example:
*
* Factorial of 5:
* !5 = ?