Skip to content

Instantly share code, notes, and snippets.

View ark234's full-sized avatar
🏠
Working from home

Arkadiy Nigay ark234

🏠
Working from home
View GitHub Profile
@ark234
ark234 / task_3.1.1.html
Last active November 15, 2017 14:14
Task 3.1.1: Create a folder and name it “ JavaScript Task 3.1 ” Using your Text editor, create a page that includes a title & 3 headings. Give your headings a Unique Identifier. Using Javascript, include a button and program your headings to change on click. Save your page and name “Javascript Task 3.1.1” in the “Javascript Task 3.1” folder.
<!DOCTYPE html>
<html>
<head>
<title>Task 3.1</title>
<style type="text/css">
#button1 {
height: 50px;
width: 200px;
background: linear-gradient(blue, yellow, green);
}
@ark234
ark234 / Task_3.1.2.html
Created November 15, 2017 14:43
Using your Text editor, open “JavaScript task 3.1.1” Using JavaScript, include a button that sources an image. Program your button to change the source of your image on click. Save your page and name “JavaScript Task 3.1.2” in the “JavaScript Task 3.1” folder.
<!DOCTYPE html>
<html>
<head>
<title>Task 3.1.2</title>
</head>
<body>
<h1>What can JavaScript Do?</h1>
<p>JavaScript can manipulate HTML attrbutes</p>
<p>Change the src (source) attribute of an image with JAVASCRIPT</p>
<button onclick="document.getElementById('myImage').src='images/shark1.jpg'">GIVE ME A HAMMERHEAD SHARK</button>
@ark234
ark234 / Task_3.2.html
Last active November 15, 2017 15:44
Task 3.2
<!DOCTYPE html>
<html>
<head>
<title>Task 3.2</title>
</head>
<body>
<h1>JavaScript Variables</h1>
<p id="UID">In this task, x, y, and z are variables</p>
<script>
@ark234
ark234 / scratch.js
Last active January 22, 2018 15:43
1/22 classroom exercise
// Stock Market Profit
// Source: InterviewCake
// Write an function called getMaxProfit that takes in an array of stock prices and returns the best profit you could have made from 1 purchase and 1 sale. The prices in the array are in the sequence in which they were purchased and can only be sold after it was first purchased.
// Input: getMaxProfit([10, 7, 5, 8, 11, 9])
// Output: 6 ..this is the result of 11 - 5
const getMaxProfit = arr => {
let max_profit = 0;
for (let i = 1; i < arr.length; i++) { // buy
@ark234
ark234 / react-color-buttons.jsx
Last active February 7, 2018 16:45
Example: how to use states in react
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = { bgColor: 'white' };