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
{ | |
"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
{ | |
"php.validate.executablePath": "/usr/local/bin/php", | |
"editor.minimap.enabled": false, | |
"editor.fontSize": 16, | |
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace", | |
"terminal.integrated.fontSize": 16, | |
"workbench.editor.showTabs": true, | |
"editor.hover.enabled": false, | |
"editor.tabSize": 2, | |
"telemetry.telemetryLevel": "off", |
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
tell application "Google Chrome" to activate | |
tell application "System Events" | |
tell process "Google Chrome" | |
click menu item "New Incognito Window" of menu "File" of menu bar 1 | |
end tell | |
end tell | |
tell first window of application "Google Chrome" to set bounds to {0, 109, 967, 658} |
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
// Place your key bindings in this file to override the defaults | |
[ | |
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" }, | |
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" }, | |
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" }, | |
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" }, | |
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" }, | |
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" }, | |
{ "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" }, | |
{ "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" }, |
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
find . -name ".DS_Store" -delete |
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
-- MySQL dump 10.13 Distrib 8.0.26, for macos11 (x86_64) | |
-- | |
-- Host: localhost Database: petfoodsreference | |
-- ------------------------------------------------------ | |
-- Server version 8.0.26 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!50503 SET NAMES utf8 */; |
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', |
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: |
OlderNewer