Skip to content

Instantly share code, notes, and snippets.

View iancover's full-sized avatar
💻

Ian Cover iancover

💻
View GitHub Profile
// Write JS code so when a user clicks on one of the
// thumbnail images, that image should be displayed
// in the full size image container at the top.
// ********* MY ANSWER ************
$(function() {
$('.thumbnail').click(function(event) {
$('.hero, img').attr();
$('.hero').append(
@iancover
iancover / index.html
Last active February 5, 2022 12:53
Text Analyzer
<!DOCTYPE html>
<html>
<head>
<title>Thinkful | Text analyzer example solution</title>
<meta charset="utf-8" />
<meta
name="description"
content="Exemplary solution for the text analyzer project from Thinkful's Front End Web Development course"
/>
@iancover
iancover / app.js
Last active February 5, 2022 12:56
Shopping List example
// **** GLOBAL STATE OBJECT ****
var state = {
items: [],
};
// **** HTML TO RENDER ****
var listItemTemplate =
'<li>' +
@iancover
iancover / app-one.js
Last active February 5, 2022 12:30
Basic node server files.
// Example 1: ECHO ENDPOINT
'use strict'
const express = require('express');
const app = express();
app.get('/echo/:what', (req, res) => {
res.json({
host: req.hostname,
path: req.path,
query: req.query,
@iancover
iancover / gatekeeper-server.js
Last active February 5, 2022 12:28
Node server example using 'query-string' npm pkg.
const express = require('express');
const queryString = require('query-string');
const app = express();
const USERS = [
{
id: 1,
firstName: 'Joe',
lastName: 'Schmoe',
userName: '[email protected]',
@iancover
iancover / mongo-examples.sh
Last active February 5, 2022 12:24
Mongo shell commands
# GET ALL
# Command that retrieves all restaurants
$ db.restaurants.find();
# LIMIT AND SORT
# Find the command that makes the first 10 restaurants appear alphabetically by 'name'
$ db.restaurants.
find().
sort({name:1}).
limit(10);