Skip to content

Instantly share code, notes, and snippets.

View dsl2022's full-sized avatar
🏠
Working from home

DSL dsl2022

🏠
Working from home
View GitHub Profile
Create a program that takes two numbers as inputs and outputs the sum of those numbers.
Write a function that takes a number as input and checks if it is even or odd. If the number is even, return true; if it is odd, return false.
@dsl2022
dsl2022 / get-json-secret.sh
Created February 15, 2023 14:11 — forked from atheiman/get-json-secret.sh
Load JSON secret from AWS Secrets Manager using AWS CLI and jq
# Load the field 'Password' from the secret 'test/MySecret' from an AWS Secrets Manager secret
PASSWORD="$(aws secretsmanager get-secret-value --secret-id 'test/MySecret' --query 'SecretString' --output text | jq -r '.Password')"
echo "The password is '$PASSWORD'"
# The password is 'MyP@55w0rd'
@dsl2022
dsl2022 / get-json-secret.sh
Created February 15, 2023 14:11 — forked from atheiman/get-json-secret.sh
Load JSON secret from AWS Secrets Manager using AWS CLI and jq
# Load the field 'Password' from the secret 'test/MySecret' from an AWS Secrets Manager secret
PASSWORD="$(aws secretsmanager get-secret-value --secret-id 'test/MySecret' --query 'SecretString' --output text | jq -r '.Password')"
echo "The password is '$PASSWORD'"
# The password is 'MyP@55w0rd'
@dsl2022
dsl2022 / algorithm_complexity.ipynb
Created January 22, 2023 17:18 — forked from Jessime/algorithm_complexity.ipynb
Algorithm Complexity in the Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// form
// firstName
// lastName
// email
// server
// mongo connection
// form model
app.post("/form/update", (req, res) => {
const body = req.params().body;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Penny Flip Game</title>
<link rel="stylesheet" href="./assets/css/style.css">
</head>
<body>
<main>
// TODO: Declare any global variables we need
let numberOfHeads = 0;
let percentageHeads = 0;
let numberOfTails = 0;
let percentageTails = 0;
let totalFlips = 0;
const heads = document.getElementById("heads");
const headsPercent = document.getElementById("heads-percent");
const tails = document.getElementById("tails");

Complexity analysis practice

Basic

question 1:

function isEven(value){
  if (value % 2 == 0){
    return true;
  }
  else

Section 1 - variables and functions:

Question 1: Create two variables. One should be a string data type, and the other should be of type int.

note that your variables could be named anything, and can have any string and int value you want

first = "hello"
second = 5