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
git archive --format=zip --output project.zip HEAD |
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
# Use root/example as user/password credentials | |
version: '3.1' | |
services: | |
db: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
restart: always | |
ports: |
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
{ | |
"debug.javascript.codelens.npmScripts": "never", | |
"editor.fontFamily": "'Monaco', monospace", | |
"terminal.integrated.fontFamily": "'Monaco', monospace", | |
"editor.fontSize": 16, | |
"terminal.integrated.fontSize": 16, | |
"editor.minimap.enabled": false, | |
"editor.tabSize": 2, | |
"breadcrumbs.enabled": false, | |
"workbench.startupEditor": "none", |
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
# You need to give this file permission to execute by doing the following... | |
# chmod +x f.sh | |
# Add an alias named f to your .zshrc file like this: | |
# alias f="/Users/brad/Documents/shell-scripts/f.sh" | |
code "$(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)" | |
# todo someday | |
# currently it only searches for folders, but it would be nice if I could search for zshrc or specific files, but I'm not sure if that will include too many files and be slow... |
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
/** | |
* @type {import('next').NextConfig} | |
*/ | |
const nextConfig = { | |
output: "export", | |
trailingSlash: true, | |
images: { unoptimized: true } | |
} | |
module.exports = nextConfig |
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
// in a new folder be sure to run "npm init -y" and "npm install puppeteer" | |
const puppeteer = require("puppeteer") | |
const fs = require("fs/promises") | |
async function start() { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
await page.goto("https://learnwebcode.github.io/practice-requests/") | |
const names = await page.evaluate(() => { |
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
{ | |
"debug.javascript.codelens.npmScripts": "never", | |
"php.validate.executablePath": "/opt/homebrew/bin/php", | |
"editor.minimap.enabled": false, | |
"editor.fontSize": 14, | |
// "editor.fontSize": 22, | |
//"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace", | |
"terminal.integrated.fontSize": 16, | |
//"editor.hover.enabled": false, | |
"editor.tabSize": 2, |
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
{ | |
"React Component": { | |
"prefix": "rc", | |
"body": ["import React, { useEffect } from \"react\"", "", "function ${1:ComponentName}() {", " return (", " <>", " $2", " </>", " )", "}", "", "export default ${1:ComponentName}"], | |
"description": "React Component" | |
}, | |
"useEffect": { | |
"prefix": "ue", | |
"body": ["useEffect(() => {", " $2", "}, [$1])"], | |
"description": "useEffect" |
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
const mongodb = require("mongodb") | |
exports.handler = async function (event, context) { | |
const client = await mongodb.connect(process.env.CONNECTIONSTRING, { useUnifiedTopology: true }) | |
const db = client.db() | |
try { | |
const dogs = await db.collection("pets").find({ species: "dog" }).toArray() | |
client.close() | |
return { |
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
const express = require('express') | |
const mysql = require('mysql2/promise') | |
const app = express() | |
let db | |
async function go() { | |
db = await mysql.createConnection({ | |
host: 'localhost', |
NewerOlder