This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./AnimalCard.css" | |
import React from "react" | |
export default props => { | |
return ( | |
<li> | |
<div className="card-body"> | |
<div className="animal__header"> | |
<h5 className="card-title"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useContext, useEffect, useRef } from "react" | |
import Animal from "./Animal" | |
import AnimalDialog from "./AnimalDialog" | |
import { AnimalContext } from "../providers/AnimalProvider" | |
import useModal from "../../hooks/ui/useModal" | |
import "./AnimalList.css" | |
export default (props) => { | |
const { toggleDialog, modalIsOpen } = useModal("#dialog--animal") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from "react" | |
const useModal = (selector) => { | |
const [modalIsOpen, setIsOpen] = useState(false) | |
function toggleDialog() { | |
setIsOpen(!modalIsOpen) | |
if (modalIsOpen) { | |
document.querySelector(`${selector}`).removeAttribute("open") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
export default ({toggleDialog, animal}) => { | |
return ( | |
<dialog id="dialog--animal"> | |
<h2> | |
Medical History for {animal.name} | |
</h2> | |
{ | |
animal.treatments.map(t => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const accounts = [ | |
{ | |
"last_login": { | |
"ip4": "201.154.17.193", | |
"date_time": "Sat Oct 22 07:25:08 UTC 1983" | |
}, | |
"id": "cold-brook-65", | |
"gender": "male", | |
"email": "[email protected]", | |
"account_age": 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
// Define a bank | |
public class Bank | |
{ | |
public string Symbol { get; set; } | |
public string Name { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
const ArticleMap = new WeakMap() | |
const Articles = Object.create(null, { | |
"init": { | |
value: function () { | |
ArticleMap.set(this, {}) | |
} | |
}, | |
"condensed": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
#!/bin/bash | |
# | |
# To create a simple project setup with just an HTML file, a JavaScript file, and a CSS file | |
# just pass the string "simple" as the first argument | |
# ex: projectsetup.sh simple | |
# | |
# - All source code will be created in the src sub-directory | |
# - If using json-server, it will be configured and started in the api sub-directory | |
# - If distributing code, grunt task will be configured to create dist sub-directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "stevebrownlee.id" is my Blockstack ID. https://explorer.blockstack.org/name/stevebrownlee.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace Bangazon.Models | |
{ | |
public class GroupedProducts | |
{ | |
public int TypeId { get; set; } | |
public string TypeName { get; set; } | |
public int ProductCount { get; set; } | |
public IEnumerable<Product> Products { get; set; } |