imposters-handbook / videos Goto Github PK
View Code? Open in Web Editor NEWCode for the videos
Code for the videos
Just a heads up there are a couple of typos in your readme text. Hanbook and east - should be Handbook and easy. Other than that great work on these videos!
This is the code for the 16 video walkthroughs in the Imposter's Hanbook. If you want to follow along, you'll need to have Node installed (6+) and, optionally, Elixir if you want to do the functional programming stuff (which you should!).
I do all of the samples within the Atom text editor using the Script Runner plugin, which is east to find and install.
Where'd you see it?
https://cs.bigmachine.io/videos/binary-math
What's the problem?
This is what I saw:
I see the video for Bitwise Operators (the next section) displayed on the website. When I click the download button, I get the proper video for Binary Math.
This is what I think it should be:
The Binary Mathematics video
How are you watching the video?
Chrome v 92.0 on a Mac.
A bit on confusion on my end working through the Bridge pattern. Hopefully someone can point me to where I'm going wrong.
The initial problem comes from wanting to formalize data access without implementing the API in every adapter. So
class SalesRepository{
// constructor and other stuff
getCart(key){
return this.db.cart.get(key);
};
}
means we have to give every adapter a cart
with get
functionality, which could be difficult to maintain. So far so good.
The CartRetrieval
bridge comes to the rescue, allowing us to house the get
logic in one place and add the bridge to our adapters, like so:
const CartRetrieval = (db) => {
return {
get: (id) => console.log(`Getting from ${db.name}`),
}
}
class PgAdapter{
constructor(){
this.name = "Postgres Adapter";
this.cart = CartRetrieval(this);
};
// Other stuff
}
So here is my confusion: The body of our bridge's get
method is just a dummy console.log
that is meant to stand in the place of the logic needed to get a particular cart
.
But each database may require a different logic to perform that get, right? How does the get
method in the CartRetrieval
know which to use? Would we switch on the db
type passed in, supplying a different strategy depending on the adapter? Should the bridge delegate back to the adapter, in which case we're back to each adapter needing to implement the API?
Thanks in advance for any help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.