Skip to content

Instantly share code, notes, and snippets.

View dpatlut's full-sized avatar
🥊
Always learning

David Patlut dpatlut

🥊
Always learning
  • Codecademy
  • Brooklyn
View GitHub Profile
@dpatlut
dpatlut / tierOne.js
Last active March 23, 2020 03:47
Tier one tests
describe('<AllCampuses /> component', () => {
//I refactored this out to be out here rather than just the first test since we are using it in a bunch of places
const campuses = [
{ id: 1, name: 'Mars Academy', imageUrl: '/images/mars.png' },
{ id: 2, name: 'Jupiter Jumpstart', imageUrl: '/images/jupiter.jpeg' },
]
beforeEach(() => {
sinon.stub(rrd, 'BrowserRouter').callsFake(({ children }) => {
return <div>{children}</div>
@dpatlut
dpatlut / db-day.md
Last active April 29, 2020 14:50
Database Day - Stable Questions

1. Since PostgreSQL is built on top of SQL - I’m assuming that all querying can be done using SQL statements in addition to some of the stuff Postgres adds to seed/traverse the database via the terminal? Are there any weird things that Postgres adds to SQL?


PSQL is not built on top of SQL. PSQL uses its own flavor of SQL language to communicate with a database. PSQL is a DBMS and SQL is a querying language.

They work together to accomplish the goal of communicating with a database. PSQL has its own features that make it unique as a DBMS such as JSON storage support (No-SQL style). I would not say there is anything “weird” in PSQL, other than extra features that you might find handy.

2. Is it ever best practice (or even possible) to store actual JavaScript code into a table? If so, what are the use cases for that?

It is relativity easy to store code in a database. Code of any language always breaks down simply into a long string that you could hypothetically store in a field. It is highly recom

@dpatlut
dpatlut / react.md
Created May 6, 2020 17:50
React Day

Implicit returns: example of how you’d use () => ({ }) syntax with a multi-line function? How does it know which expression to return?

Answer: https://medium.com/@bunlong/arrow-functions-return-rules-in-javascript-b63ed5f25994 Check this out Barish! It looks like “multiline” just represents one statement spread out on multiple lines for implicit return. I believe you only can still have one item/variable/param/arg returned via the multiline implicit.

Is there a way to define properties with JSX expressions that include evaluated expressions inside strings like we usually do using template literals? (e.g. className=${value} otherClass). The only method I found searching around was to define the string elsewhere and then plug it in as a single evaluated expression.

Answer: You should be able to still use template literal expressions like this:

@dpatlut
dpatlut / sg.md
Created May 14, 2020 18:24
Senior Gateway FAQ

Senior Gateway

Below is the plan for the "senior gateway": how we determine whether you are ready to continue to senior phase. This will be based heavily on your performance on the "Senior Checkpoint" and as a back-up the "Junior Phase Final Project". Let's talk about the logistics…

What

The Junior Phase Final Project (JPFP) is, well, a project you will complete SOLO. You will be expected to construct a working full-stack application. We will provide the constraints for what you should build (e.g. "users should be able view all of their uploaded photos"). In order to allow your implementation to be more open-ended and organic, we will not provide automated test specs. 📖 JPFP Study Guide

The Senior Checkpoint is test-spec based and you will also be working solo. To reiterate, instead of providing written-in-English constraints for how it should operate, we will provide automated test spe

@dpatlut
dpatlut / jpfpstudyguide.md
Created May 14, 2020 18:25
JPFP Study Guide

Junior Phase Final Project Study Guide

What is the Junior Phase Final Project?

A reasonably large solo project you will work on during week 5 of junior phase.

What is it for?

Determining whether you are ready for what's coming in senior phase: whether you will be able to contribute meaningfully to group projects and whether you are in a place to benefit (instead of flounder) from the senior phase curriculum.

@dpatlut
dpatlut / seniorcheckpointguide.md
Created May 14, 2020 18:27
Senior Checkpoint Study Guide

Senior Checkpoint Study Guide

What is the senior checkpoint?

A test-spec-based assessment (similar to previous checkpoints, e.g. pillars) covering: Express, Sequelize, React, Redux, and JS algorithms.

What is it for?

Determining whether you are ready for what's coming in senior phase: whether you will be able to contribute meaningfully to group projects and whether you are in a place to benefit (instead of flounder) from the senior phase curriculum.

@dpatlut
dpatlut / async.js
Created June 8, 2020 03:34
asyncAction
console.log('Hellow')
setTimeout(() => { console.log('a new') }, 5000)
console.log('World')
@dpatlut
dpatlut / asyncloop.js
Created June 8, 2020 03:40
Async Loop Exit Ticket
for (var x = 0; x < 3; x++) {
setTimeout(() => console.log(x), 100);
}
@dpatlut
dpatlut / git.md
Created June 15, 2020 16:30
Git Workflow

GitHub Workflow

Feature Branches

High level overview: pull latest master, make a branch, commit changes, push to GitHub, make a PR, get it approved, merge it to master. Rinse and repeat.

  1. Make issue corresponding to feature
  2. git checkout master
  3. git pull to get master up to date
  4. git checkout -b YOUR-NEW-BRANCH-NAME to switch to a new branch
@dpatlut
dpatlut / gspresentations.md
Last active February 20, 2021 20:33
Grace Shopper Presentations

Presenting Grace Shopper

Presentation Overview

Your presentation will be given to your instructor and assigned fellow, plus any other available staff. It will include a general overview / demo of your application followed by various code-focused sections. The whole presentation should last no more than 11 minutes. Practice beforehand to calibrate how much time that is!

General Application Overview (~2 minutes)

Show a single basic & fast run-through of your application from first-time visitor to ordering a product(s). Highlight what is unique about your application and thoughts behind the decisions made regarding features and user experience (includes visual structure and design). We recommend having demo screens / tabs already set up so you do not waste time, e.g. typing in long forms.