This file contains 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 { useContext, useState, useEffect } from "react"; | |
import styled, { ThemeContext } from "styled-components"; | |
import dynamic from "next/dynamic"; | |
import historicCRResults from "../../data/processed/2024/city-ratings-all-historical-results-v24.2-short-mod-with-slugs-nivo-compatible.json"; | |
import { | |
historicCanadianCityList, | |
historicSmallCityList, | |
historicMediumCityList, | |
historicLargeCityList, |
This file contains 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
/* Newsletter */ | |
.spkactionform dd { | |
font-size: 14px; | |
padding-top: 0.3vh; | |
} | |
.spkactionform dd label { | |
font-size: 14px; | |
line-height: 1.5; | |
} |
This file contains 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
// https://www.cluemediator.com/search-filter-for-multiple-object-in-reactjs | |
import React, { useState } from 'react'; | |
function App() { | |
const dataList = [ | |
{ | |
"id": 1, | |
"name": "cerulean", | |
"year": 2000, |
This file contains 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
// 3- Take listItemsArray and loop through it w/ regex | |
for (var i = 0; i < listItemsArray.length; i++) { | |
// 4- Use regex to break each list item into five pieces | |
listItemsTemp[i] = listItemsArray[i].match(/(<li\b(?:>\s+(?:id="([^"]*)"|class="([^"]*)")|[^\s>]+|\s+)*>)|((<\w+\b>)|(<a\shref=".*">)|(.+?(?=<))|(<\/\w+\b)>)/g); | |
// 5- Setup listItemsRearranged[i] with an array of listItemsTemp.length | |
listItemsRearranged[i] = new Array(listItemsTemp.length); | |
// 6- Take listItemsTemp and reassign positions |
This file contains 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' | |
import Link from 'gatsby-link' | |
import styled from 'styled-components' | |
// Styles, w/ styled-component syntax | |
const NavContainer = styled.nav` | |
background-color: ${props => props.theme.lightGray}; | |
font-size: 14px; | |
max-width: ${props => props.theme.xs}; | |
overflow: auto; |
This file contains 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
// Mongo DB commands | |
db.restaurants.insert({ | |
"name": "Haikan", | |
"address" : { | |
"street" : "805 V Street NW", | |
"zipcode" : 20001 | |
}, | |
"cuisine": "Ramen" | |
}) |
This file contains 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' | |
/* Handling a Form */ | |
class Form extends React.Component { | |
// Set up a state object that's just empty | |
// You'll see why it's empty in handleChange | |
constructor(props) { | |
super(props); | |
this.state = {}; |
This file contains 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
// Give Node access to path | |
const path = require('path') | |
const fs = require('fs') | |
// Setup parser for taking apart the HTML Description hack stuff from Shopify | |
const DomParser = require('dom-parser') | |
const shopifyDescParser = new DomParser() | |
exports.createPages = async ({ graphql, actions }) => { | |
const { createPage } = actions |
This file contains 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 my Blockstack ID is secured with the address 19Qdh8zaHkHj6QxQdgf7eRnRjhhZkzaSBs https://explorer.blockstack.org/address/19Qdh8zaHkHj6QxQdgf7eRnRjhhZkzaSBs |
NewerOlder