Skip to content

Instantly share code, notes, and snippets.

@MonaTem
MonaTem / async_and_callbacks.js
Created September 17, 2017 21:31 — forked from leoallen85/async_and_callbacks.js
Exercises for understanding asynchronous JS and callbacks.
// Callbacks
// Complete this function so that it passes the numbers 1 and 2 into the callback
function two_numbers(callback){
// TODO
}
two_numbers(function(x, y){
console.log(x, y);
}
@MonaTem
MonaTem / app.js
Created January 7, 2018 16:57 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');

Monday

  • 9:00 reading, exercise, or primer 📓
  • 9:30 overview of morning activity
  • 9:55 fill out standup 📋
  • 10:00 stand up ⬆️
  • 10:30 lecture
  • 11:50 wrap up
  • 12:00 lunch 🍽
  • 4:30 stand down ⬇️

Intro to Immutable JS

  • Immutable is maintained by Facebook, so you can expect it to always be in sync with React.
  • The API is written in typeScript? at the very least it has special syntax
  • value could be inflated because of FB and React.

Immutable JS

Immutable basics

@MonaTem
MonaTem / jsx-html-differences.md
Created February 3, 2018 01:57 — forked from parshap/jsx-html-differences.md
Difference between JSX and HTML
  • className attribute instead of class
  • htmlFor attribute instead of for
  • <textarea value="something"> instead of <textarea>something</textarea> (see Why Textarea Value)
  • <select value="something"><option value="something"></select> instead of <select><option selected value="something"></select> (see Why Select Value)
  • Whitespace (see discussion)
  • [Tags must be closed and all tags can be self-closing][closing tags]

The 5 Ways of Fibonacci

Terminology in methods

  • recursion
  • generators
  • memoization
@MonaTem
MonaTem / App.js
Created March 8, 2018 22:54 — forked from eddywashere/App.js
Reactstrap App.js Example for create-react-app
import React, { Component } from 'react';
import {
Collapse,
Navbar,
NavbarToggler,
NavbarBrand,
Nav,
NavItem,
NavLink,
Container,
@MonaTem
MonaTem / revert-a-commit.md
Created March 17, 2018 18:57 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@MonaTem
MonaTem / todo.md
Created March 17, 2018 19:27
g72 Warm Up!

React ToDo

From the command line, create a react app with create-react-app and then do the following:

Base goal: Create two new components, one called TodoInput and another called TodoList. Wire up TodoInput to add todos to the todo list.

Stretch goal 1: Modify the app to where it is unable to submit a new todo if the input field is blank.

Stretch goal 2: Allow users to remove todos from the list using a "remove" button next to each todo.

@MonaTem
MonaTem / palindrome_warmup.md
Created March 26, 2018 14:25
Palindrome warmup

A palindrome is a string that reads the same forward and backward. So for example, racecar is a palindrome.

Palindromes are not very strict.

  • They're case insensitive (Bob).
  • They ignore spaces (taco cat).
  • They ignore punctuation (Go hang a salami! I'm a lasagna hog!)

Write a function that takes a string as input and returns true if the string is a palindrome, false if it isn't. Follow the bullet points and make it as loose as you can.