Skip to content

Instantly share code, notes, and snippets.

{
"vim.easymotion": true,
"vim.incsearch": true,
"vim.insertModeKeyBindings": [{ "before": ["j", "k"], "after": ["<Esc>"] }],
"vim.useSystemClipboard": true,
"vim.overrideCopy": false,
"vim.useCtrlKeys": false,
"vim.handleKeys": {
"<C-BS>": false,
"<C-d>": false
@zachgoll
zachgoll / full-gallery-dynamic.tsx
Created October 29, 2022 19:04
Next.js Image Gallery
@zachgoll
zachgoll / ExamplePage.tsx
Last active October 20, 2022 11:54
Module not found: can't resolve 'fs' error
/** THIS FILE THROWS AN ERROR! */
import type { GetServerSideProps } from "next";
import { getFileExistence, formatResult } from './file-utils.ts'
type Props = {
doesFileExist: boolean;
};
const myArray = [20, 30, 40];
console.log(myArray[3]);
const objectVariable = {
property1: 'i am property 1';
property2: 'i am property 2';
property3: [20, 30, 40];
};
console.log(objectVariable.property3[2]);
const variable1 = 20;
const variable2 = '40';
const resultVariable = variable1 + variable2;
console.log(resultVariable);
const some Number = 20;
someNumber = 50
// This is a JavaScript comment. It doesn't affect the code at all
// Here, we are selecting the <body></body> HTML tag
const htmlBody = document.querySelector("body");
// This is a function
const randomClickFunction = function () {
// This is an array of color codes.
const colors = ["#002942", "#0CA7DB", "#F56C05", "#DB3E00", "purple"];
// This will calculate a random "index" that we can use to select a color in the array
const nestedObject = {
layerOne: {
layerTwo: {
layerThree: {
layerFour: {
layerFive: {
theValueWeWant: 'here is my value'
}
}
}
const nestedObject = {
layerOne: {
layerTwo: {
layerThree: {
layerFour: {
layerFive: {
theValueWeWant: 'here is my value'
}
}
}