Skip to content

Instantly share code, notes, and snippets.

View stephepush's full-sized avatar

Stephen Peters stephepush

View GitHub Profile
-- DROP TABLE car_photos;
-- DROP TABLE cars;
CREATE TABLE cars (
car_id INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
model_year SMALLINT NOT NULL,
make VARCHAR(80) NOT NULL,
model VARCHAR(90) NOT NULL,
miles INTEGER NOT NULL,
@stephepush
stephepush / gist:9f3a9cc9f8042a02f169ff2268281f63
Created January 23, 2020 16:07
email-collector-pg-backup-dump
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.6 (Ubuntu 11.6-1.pgdg19.04+1)
-- Dumped by pg_dump version 12.1 (Ubuntu 12.1-1.pgdg19.04+1)
-- Started on 2020-01-23 11:03:53 EST
SET statement_timeout = 0;
@pcgeek86
pcgeek86 / Car Manufacturers.json
Last active June 4, 2024 07:46
Plain-text list of major car manufacturers
[
"Abarth",
"Alfa Romeo",
"Aston Martin",
"Audi",
"Bentley",
"BMW",
"Bugatti",
"Cadillac",
"Chevrolet",

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@adrian-enspired
adrian-enspired / PDO_mysql.connect.php
Last active November 17, 2021 03:16
how to make a new mysql connection with PDO.
<?php
$host = "db hostname";
$dbname = "db name";
$user = "db username";
$pass = "db password";
$charset = "UTF8MB4"; // if your db does not use CHARSET=UTF8MB4, you should probably be fixing that
$dsn = "mysql:host={$host};dbname={$dbname};charset={$charset}";
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active July 19, 2024 14:51
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@tylerbuchea
tylerbuchea / JSKeyCodes
Created December 17, 2013 19:58
List of JavaScript key codes.
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
caps lock 20
escape 27
page up 33