Skip to content

Instantly share code, notes, and snippets.

View jtomchak's full-sized avatar
🐋
Chippin' away at it

Jesse Tomchak jtomchak

🐋
Chippin' away at it
View GitHub Profile
@jtomchak
jtomchak / app.js
Created February 7, 2018 23:00
Movie Town upgraded from posters to cards with titles and buttons!!!!!
import "jquery";
import "./style.scss";
$(document).ready(function() {
console.log("I am working with jQuery. Sweet!!!!");
let moviesList = [];
//Get Movies HTTP request!
const getMovies = () => {
const movieURL =
@jtomchak
jtomchak / app.js
Created February 8, 2018 18:24
Movie Town with poster card and button events
import "jquery";
import "./style.scss";
$(document).ready(function() {
console.log("I am working with jQuery. Sweet!!!!");
let moviesList = [];
//Get Movies HTTP request!
const getMovies = () => {
const movieURL =
@jtomchak
jtomchak / Checkout.js
Created February 13, 2018 18:54
Form Exercise
////////////////////////////////////////////////////////////////////////////////
// Exercise
//
// - When the checkbox is checked:
// - Fill in the shipping fields with the values from billing
// - Disable the shipping fields so they are not directly editable
// - Keep the shipping fields up to date as billing fields change
// - Hint: you can get the checkbox value from `event.target.checked`
// - When the form submits, console.log the values
//
@jtomchak
jtomchak / Checkout.js
Created February 13, 2018 22:19
Checkout Part 2
////////////////////////////////////////////////////////////////////////////////
// Exercise
//
// - When the checkbox is checked:
// 5- Fill in the shipping fields with the values from billing
// 6- Disable the shipping fields so they are not directly editable
// 7- Keep the shipping fields up to date as billing fields change
// - Hint: you can get the checkbox value from `event.target.checked`
// - When the form submits, console.log the values
//
@jtomchak
jtomchak / AppButton.js
Created February 14, 2018 21:04
Button with click event and setState
class App extends React.Component {
state = {
helpButtonActivated: false
};
handleHelpClick = event => {
this.setState({
helpButtonActivated: !this.state.helpButtonActivated
});
};
@jtomchak
jtomchak / Tabs.js
Created February 14, 2018 22:06
Tabs with onClick
class Tabs extends React.Component {
state = {
activeTabIndex: 0
};
handleTabClick = event => {
this.setState({
tabActivated: 1
});
};
@jtomchak
jtomchak / Geolocation.js
Last active February 15, 2018 23:07
Geolocation working
////////////////////////////////////////////////////////////////////////////////
// Exercise:
//
// - Refactor App by creating a new component named `<GeoPosition>`
// - <GeoPosition> should use a child render callback that passes
// to <App> the latitude and longitude state
// - When you're done, <App> should no longer have anything but
// a render method
//
// Got extra time?
@jtomchak
jtomchak / GeoAddress.js
Created February 16, 2018 18:14
GeoAddress for GeoPosition
import React, { Component } from "react";
import getAddressFromCoords from "./utils/getAddressFromCoords";
class GeoAddress extends Component {
state = { address: null };
componentDidMount() {
//if what?
if (this.props.latitude && this.props.longitude) {
@jtomchak
jtomchak / App.js
Created February 21, 2018 18:09
Monster Music
import React from "react";
import "./App.css";
const MUSIC = [
{
name: "Radiohead",
albums: [
{
title: "The King of Limbs",
songs: [
@jtomchak
jtomchak / s3BucketSize.js
Created March 14, 2018 05:32
Node aws Calculating file size
const AWS = require("aws-sdk");
const s3 = new AWS.S3();
let s3DataContents = [];
s3.listBuckets(function(err, data) {
if (err) {
console.log("Error", err);
} else {
data.Buckets.forEach(function(value) {