Skip to content

Instantly share code, notes, and snippets.

View SydBal's full-sized avatar
🛠️
Tinkerer

Dominic Balassone SydBal

🛠️
Tinkerer
View GitHub Profile
@SydBal
SydBal / argvToGlobal.js
Created January 14, 2020 08:35
NodeJS: Mapping argv to global
import { argv } from 'yargs'
Object.entries(argv).forEach(([key, value]) => { global[key] = value })
@SydBal
SydBal / prefers-reduced-motion.css
Created October 21, 2020 03:38
Prefers Reduced Motion Hard Override
/*
It may be wise to include this at the bottom of your body so that
it overrides css which comes before it in the document.
*/
@media (prefers-reduced-motion) {
* {
animation: none !important;
transition: none !important;
}
}
@SydBal
SydBal / TicTacToe.jsx
Created January 18, 2024 04:58
React TicTacToe
import React, { useState } from "react";
const TicTacToe = () => {
const [board, setBoard] = useState(Array(9).fill(null));
const [isPlayerXNext, setIsPlayerXNext] = useState(true);
const [winner, setWinner] = useState(null);
const calculateWinner = (squares) => {
const lines = [
[0, 1, 2],