Skip to content

Instantly share code, notes, and snippets.

View jeremiahbiard's full-sized avatar

Jeremiah Biard jeremiahbiard

View GitHub Profile
@jeremiahbiard
jeremiahbiard / System Design.md
Created October 26, 2020 04:03 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jeremiahbiard
jeremiahbiard / System Design.md
Created October 26, 2020 04:03 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jeremiahbiard
jeremiahbiard / rom_utils.rs
Created June 3, 2018 02:01
load_rom function
pub fn load_rom<'a, P: AsRef<Path>>(path: P) -> Result<&'a Vec<u8>, Box<Error>> {
let mut fh = fs::File::open(path)?;
let mut program: &'a mut Vec<u8> = &mut Vec::new();
fh.read_to_end(&mut program)?;
Ok(program)
}
(defun comp (a b)
(cond ((< a b) 'bob)
((> a b) 'alice)))
(defvar a (with-input-from-string (in (read-line))
(loop for x = (read in nil nil) while x collect x)))
(defvar b (with-input-from-string (in (read-line))
(loop for x = (read in nil nil) while x collect x)))
/* Simple example of generator function in javascript */
let timer;
function* generatorFn() {
let iterations = 0;
let done = false
while(!done) {
console.log(`I've run ${iterations} times!`);
iterations += 1;
if (iterations === 6) {
done = true;
@jeremiahbiard
jeremiahbiard / c_notes.md
Created November 17, 2016 15:25
CS50 C Notes

// Pointers!!! /* Pass by reference int 4 char 1 float 8 double 8 long long 8 A pointer is nothing more than an address value is a memory address

Hash tables
Linked lists
Breadth-first search, depth-first search
Quicksort, merge sort
Binary search
2D arrays
Dynamic arrays
Binary search trees
Dynamic programming
Big-O analysis
var co = require('co');
var request = require('co-request');

co(function*(){
  var urls = process.argv.slice(2,5);
  var res = yield urls.map(request);
  res.forEach(console.log);
})();

#Notes

Test Does this work?

/*
* Reactive extensions to Javascript.
asynchronous data streams
* Data streams can be created from:
UI Events
Http Requests
File Systems
Array-like Objects
Memory/Cache
Promises