Skip to content

Instantly share code, notes, and snippets.

View JoeShep's full-sized avatar

Joe Shepherd JoeShep

  • Nashville Software School
  • Nashville
View GitHub Profile
@JoeShep
JoeShep / README_HOW_TO.md
Created January 26, 2022 16:17 — forked from heymonicakay/README_HOW_TO.md
Some tips on how to create a readable README to show off your project.

Add a README To Your Project

You can add a README file to your repository to tell other people why your project is useful, what they can do with your project, and how they can use it.

What's in a README?

README files typically include information on:

  • Primary Features - What does this project do?
  • Target Audience - Who is it for?
  • Purpose - Why the project is useful/what problem does it solve?
Fundamental review of array methods in JS
@JoeShep
JoeShep / lodash-test.js
Created July 6, 2017 20:06
A couple of lodash methods to whet your appetite
// *********** Simple but awesome ***********
console.log("random num", _.random(10, 20));
// *********** Loop it ***********
_.times(5, function(i) {
console.log("adding", i + 2);
});
let testArr = ["wow", "neat", "cool"];
@JoeShep
JoeShep / block-module.js
Created June 19, 2017 14:39
An ES6 module; alternative to iife syntax
{
let planetsArr = [];
let dwarfPlanets = [];
let planetsLandedOn = 0;
planetsArr.push("mercury", "Venus", "earth", "MArs", "jupiter", "saturn", "uranus", "Neptune");
let planets = Object.create(null);
planets.setPlanetsLandedOn = function(count) {
@JoeShep
JoeShep / arrays.js
Created June 13, 2017 16:48
array methods
let colors = ["red", "blue", "green", "yellow", "orange", "teal"];
// let colorStrings = []
// colors.forEach(function(item) {
// colorStrings.push("I like the color" + " " + item)
// });
// console.log("new array", colorStrings);
let reversedColors = colors.map( function(item) {
return item.split("").reverse().join("");
@JoeShep
JoeShep / test.md
Created June 13, 2017 14:36
Markdown example

ES6 Awesomeness

this should be intalicized

this should be bold

  • Task one
  • task two
  • buy lunch
@JoeShep
JoeShep / object.js
Created June 6, 2017 16:11
Object example
const song = {
title: "Private Idaho",
artist: "The B-52s",
plays: 120,
album: "Wild Planet",
bandMembers: [
{name:"Fred", roles: {vocals: "lead", instrument: null} }
// {"Cindy",
// {"Ricky",
// {"Keith",
@JoeShep
JoeShep / main.js
Created March 14, 2017 20:42
Mocha: Testing with Promises
'use strict';
const sqlite3 = require('sqlite3');
const db = new sqlite3.Database('./acme.sqlite', (wat) => {
console.log("Is this connection open?", wat);
});
const getCustomer = (custPhone) => {
return new Promise( (resolve, reject) => {
db.get(`SELECT first_name, last_name FROM customers WHERE phone = "${custPhone}"`, (err, customer) => {
@JoeShep
JoeShep / properties.js
Created November 5, 2016 19:30 — forked from seanspradlin/properties.js
Object properties tutorial
function Person(firstName, lastName, age, ssn) {
// Declaring this way by default will make your property
// readable, writable, and enumerable
this.firstName = firstName;
this.lastName = lastName;
// Let's make a getter-only method that returns the
// two values as a whole name
Object.defineProperty(this, 'fullName', {
get: function() {
@JoeShep
JoeShep / index.html
Last active October 17, 2016 22:19
Event Listeners intro
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Nashville Software School</title>
<link rel="stylesheet" type="text/css" href="events.css">
</head>
<body>