Skip to content

Instantly share code, notes, and snippets.

View joshuaaguilar20's full-sized avatar
🎯
Focusing

Joshua Aguilar joshuaaguilar20

🎯
Focusing
View GitHub Profile
@joshuaaguilar20
joshuaaguilar20 / vote.c
Created February 13, 2023 16:55
CS 50 Vote
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
// Max number of candidates
#define MAX 9
// Candidates have name and vote count
typedef struct
@joshuaaguilar20
joshuaaguilar20 / resources.md
Last active February 1, 2023 19:21
Programming Resources

Best Base Course for CS fundamentals: Best LECTURES In all of CS. If you dont do the corurse the lectures are 2nd to non. Starts with C. C++ is built upon C and thus supports all features of C and also, it has object-oriented programming features. When it comes to learning, size-wise C is smaller with few concepts to learn while C++ is vast. Hence we can say C is easier than C++.

Great CLI TRAINING

Best for javascript projects/algorithms:

@joshuaaguilar20
joshuaaguilar20 / record.js
Created January 24, 2023 19:08
Record User Actions and send to server
function recordUserActions() {
// Add event listeners for all relevant events
document.addEventListener('click', recordClick);
// document.addEventListener('submit', recordSubmit);
// document.addEventListener('change', recordChange);
document.addEventListener('keypress', recordKeyPress);
// Function to record a click event
function recordClick(event) {
// Send the event data to the server
@joshuaaguilar20
joshuaaguilar20 / debug.c
Created January 23, 2023 22:08
Homework C Zach
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int getNumLetters(string text);
int getNumSentences(string text);
int getNumWords(string text);
int getGradeLevel(int numLetters, int numSentences, int numWords);
@joshuaaguilar20
joshuaaguilar20 / readme.md
Last active December 12, 2022 02:12
Learning Path:
@joshuaaguilar20
joshuaaguilar20 / diskutil.sh
Last active September 21, 2021 22:40
Diskutil how to create multiple partions on USB disk. How to Create multiple partions USB disk. Mac/Linux. Simple. Native
# find dev you want to partion
diskutil list
#/dev/disk5
#erase disk and format with fat32
sudo diskutil eraseDisk FAT32 GPT /dev/disk5
#use diskutility
sudo diskutil partitionDisk /dev/disk5 GPT JHFS+ New 4gb
@joshuaaguilar20
joshuaaguilar20 / waitForit.md
Last active August 6, 2021 02:46
Wait for it health

How to wait for function to become true or false.

const startGame = () => {
return new Promise((res,rej) => {
while(health >= 0){
  console.log("ATTACKED")
  console.log(health)
  if (health === 0) {
    res('GAME OVER')
 break;
@joshuaaguilar20
joshuaaguilar20 / loop.md
Created August 6, 2021 02:44
Proper Async await foreach loop
  1. foreach loop does not work for async and always returns undefined.
  2. for of loop must be used.
//PROPER ASYNC AWAIT FOREACH LOOP


const arr = [1,2,3,4,5,6,7,8,9,10]

for (const [index, value] of arr.entries()) {
@joshuaaguilar20
joshuaaguilar20 / projectlist.md
Created July 28, 2021 22:57
Tommy Project List

Build Threat Dashboard

  • Inside of threat-DB user one of the open souce APIs and fetch threats.

Investigations APIs The Investigations Application Programming Interfaces (APIs) let you build, delete, modify, or list the Investigation objects in USM Central. You can also use the APIs to download attachments, add evidence, or create notes for the Investigation object.

The Investigations APIs are based on the Representational State Transfer (REST) architecture standard. You must access the APIs using Hypertext Transfer Protocol Secure (HTTPS) on port 443. This document explains how to access the endpoints, how to construct your requests, and what errors you may receive.

@joshuaaguilar20
joshuaaguilar20 / promise.md
Last active July 19, 2021 20:28
Promises

Promises

  • item one
  • item teo

Get

  • fetching info
 fetch(newURL)
 .then(response =&gt; response.json())