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
<!-- index.html --> | |
<html> | |
<body> | |
<div> | |
<div id="app"> | |
</div> | |
<script src="https://unpkg.com/react@17/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> |
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
<!-- index.html --> | |
<html> | |
<body> | |
<div> | |
<div id="app"> | |
</div> | |
<script src="https://unpkg.com/react@17/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> |
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
<!-- index.html --> | |
<html> | |
<body> | |
<div> | |
<div id="app"></div> | |
<script type="text/javascript"> | |
const app = document.getElementById('app') | |
const header = document.createElement('h1') |
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
// cli or react? cli! | |
// start game | |
// make a guess | |
// see past guesses (if any) | |
// recieve response for guess | |
// colors: red, yellow, blue, green, purple, orange |
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
console.log('tic tac toe, three in a row...') | |
const readline = require('readline').createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const printBoard = (board) => { | |
console.log( | |
`\n`, |
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
function Contributions({items, handleSetShowContributions} : {items: any, handleSetShowContributions: (state: boolean) => void}) { | |
const yearArray = Array.from(Array(365).keys()) | |
// console.log('yearArray', yearArray) | |
// loop through items and create an array of days of the year with the number of items created on that day | |
const contributions = yearArray.map((day: number) => { | |
const date = new Date() | |
date.setDate(date.getDate() - day) | |
const dateString = date.toISOString().substring(0, 10) | |
const itemsCreatedOnDate = items.filter((item: any) => { | |
return item.createdAt.toISOString().substring(0, 10) === dateString |
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
.container { | |
/* z-index: -1; */ | |
position: absolute; | |
margin: 0 auto; | |
display: flex; | |
flex-direction: row; | |
background: hsl(0, 0%, 90%); | |
right: 0; | |
left: 0; | |
margin-left: auto; |
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
// find the project | |
p = Project.find [projectID] | |
// create and save the funds payout in db | |
po = Payout.new | |
po.project_id = p.id | |
po.credit_type = 0 | |
po.amount = [amount] | |
po.token = "[tokenID]" | |
po.user_id = [userID] (mine is 5) |
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
export function htmlToText(html: string) { | |
return html && html.replace(/<[^>]+>/g, '').replace(/ /g, ` `) || '' | |
} |
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 type { ReadTransaction, WriteTransaction } from "replicache"; | |
import { nanoid } from "nanoid"; | |
import { z } from "zod"; | |
export const itemSchema = z.object({ | |
type: z.literal(`item`), | |
createdAt: z.string(), | |
createdBy: z.string(), | |
title: z.string(), | |
content: z.string(), |