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 / ClosuresCheatsCH2.js
Last active February 25, 2019 22:37
Closure Cheats( Do Not Use) CH-2
function foo(str) {
"use strict";
eval( str );
console.log( a ); // ReferenceError: a is not defined
}
foo( "var a = 2" );
` There are other facilities in JavaScript that amount to a very similar
effect to eval(..) . setTimeout(..) and setInterval(..) can take a
string for their respective first argument, the contents of which are
@joshuaaguilar20
joshuaaguilar20 / functionExpressions.js
Created February 25, 2019 23:14
Function Expressions
"use strict";
``
var a = 2;
(function foo(){ // <-- insert this
var a = 3;
console.log( a ); // 3
@joshuaaguilar20
joshuaaguilar20 / Notes.Md
Created June 26, 2019 16:37
Tom Leighton's MIT Mathmatical Proofs Course Week 1

Predicate: Proposition whos truth depends on the value of the variable, Prime Numbers: used to Break RSA Encrytions Implication: p => q if p is false or q is true = will be true False Implys Anything is True* (if Pigs could fly I would be king ) Proposition - True or False

Truth Table p|q| p => q | q <=> p| p <==> q|

@joshuaaguilar20
joshuaaguilar20 / week-2.js
Created August 21, 2019 00:24
Lesson Plan Student Deep
/*
Review Functions and String Literals
Examples Below
*/
function nameOfFunction(input){
//This Defines The Function The Input It takes and the Output it Returns.This Does Not Run the Function
console.log(`this is my input: ${input}`);
};
@joshuaaguilar20
joshuaaguilar20 / Greedy.txt
Last active September 4, 2019 01:58
Week 3 Project Deep D
Greedy Algorithms
US coins
When making change, odds are you want to minimize the number of coins you’re dispensing for each customer, lest you run out (or annoy the customer!). Fortunately, computer science has given cashiers everywhere ways to minimize numbers of coins due: greedy algorithms.
According to the National Institute of Standards and Technology (NIST), a greedy algorithm is one “that always takes the best immediate, or local, solution while finding an answer. Greedy algorithms find the overall, or globally, optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems.”
What’s all that mean? Well, suppose that a cashier owes a customer some change and in that cashier’s drawer are quarters (25¢), dimes (10¢), nickels (5¢), and pennies (1¢). The problem to be solved is to decide which coins and how many of each to hand to the customer. Think of a “greedy” cashier as one who wants to take the biggest bite out of this problem as possi
@joshuaaguilar20
joshuaaguilar20 / Main.go
Last active September 4, 2019 15:31
Deep D Week 3 Go Lang
#1 Understand the Native Modules Provided
#2 Go is based on using native modules as opposed to using NPM
Link To Documents
https://golang.org/pkg/
Tuff Concepts
@joshuaaguilar20
joshuaaguilar20 / digits.go
Created September 6, 2019 22:52
Printing Numbers From String to Byte to Hex, Binary
func main() {
s:= "A"
bs:= []byte(s)
fmt.Println(bs)
n:=bs[0]
fmt.Printf("%T \n", n)
fmt.Printf("%b \n", n)
fmt.Printf("%#X\n", n)
@joshuaaguilar20
joshuaaguilar20 / iota.go
Created September 6, 2019 23:00
Go Iota
package main
import "fmt"
const (
A0 = iota
A1 = iota
A2 = iota
@joshuaaguilar20
joshuaaguilar20 / main.go
Created September 6, 2019 23:14
Bit Shifting Go Lang
package main
import "fmt"
func main() {
// x:= 4
// fmt.Printf("%d\t\t%b\n", x, x)