Skip to content

Instantly share code, notes, and snippets.

Alex Singleton alexanderjsingleton

Block or report user

Report or block alexanderjsingleton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alexanderjsingleton
alexanderjsingleton / create.sql
Created May 16, 2017
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
View create.sql
CREATE TABLE VEHICLE
(
VIN VARCHAR(30) NOT NULL,
Make VARCHAR(30) NOT NULL,
Model VARCHAR(30) NOT NULL,
Year INT NOT NULL,
Color CHAR(30) NOT NULL,
LicensePlate VARCHAR(20) NOT NULL,
Mileage INT NOT NULL,
PRIMARY KEY (VIN),
@alexanderjsingleton
alexanderjsingleton / create.sql
Created May 16, 2017
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
View create.sql
CREATE TABLE VEHICLE
(
VIN VARCHAR(30) NOT NULL,
Make VARCHAR(30) NOT NULL,
Model VARCHAR(30) NOT NULL,
Year INT NOT NULL,
Color CHAR(30) NOT NULL,
LicensePlate VARCHAR(20) NOT NULL,
Mileage INT NOT NULL,
PRIMARY KEY (VIN),
@alexanderjsingleton
alexanderjsingleton / insert.sql
Last active May 16, 2017
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
View insert.sql
/* This section populates the Customers table */
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000001, 'John', 'Constantine', 'jconstantine@jld.org', '999990013', '0000013');
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000002, 'Hal', 'Jordan', 'hjordan@glcorps.org', '999990001', '0000001');
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000003, 'Barry', 'Allen', 'ballen@jla.org', '999990002', '0000002');
@alexanderjsingleton
alexanderjsingleton / reporter.sql
Created May 16, 2017
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
View reporter.sql
-- Oldest Reservation
SELECT * FROM RESERVATION
WHERE Pick_Up_Date = (SELECT MIN(Pick_Up_Date) FROM RESERVATION);
-- Customer Reservations with Make and Model of Vehicle
SELECT CUSTOMER.CustomerID, CUSTOMER.CustomerFname AS First_Name, CUSTOMER.CustomerLname AS Last_Name, RESERVES.VIN, VEHICLE.Make, VEHICLE.Model
FROM (((CUSTOMER
INNER JOIN RESERVATION ON CUSTOMER.CustomerID = RESERVATION.CustomerID)
@alexanderjsingleton
alexanderjsingleton / OhMyZshConfig.md
Last active Dec 27, 2016
Easiest way to install OhMyZsh as your terminal-shell
View OhMyZshConfig.md
  1. Assuming git is installed, git clone git://zsh.git.sf.net/gitroot/zsh/zsh
  2. curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  3. chsh -s /bin/zsh
  4. Restart terminal.
  5. cd ~/zsh and verify install!
@alexanderjsingleton
alexanderjsingleton / sublime-instructions.md
Last active Dec 4, 2016
How to create Sublime short-cut in terminal via bash-profile in Mac OS X Sierra.
View sublime-instructions.md

Sublime Text Shortcut Guide

  1. Open Mac Terminal
  2. Go to homebrew.sh; copy and enter the following: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Enter brew install wget
  4. Enter the following into your Mac Terminal: open ~/.bash_profile but if for whatever reason you don't have one configured, enter sudo nano .bash_profile.
  5. To become sufficiently Rubified: brew install ruby
  6. Download Sublime Text 3 then go to root/usr (e.g. cd alexanderjsingleton/).
@alexanderjsingleton
alexanderjsingleton / Facebook360JSExample.js
Created Aug 29, 2016
WordPress * Facebook360 Integration for Embed
View Facebook360JSExample.js
<script>window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v2.5'
});
}; (function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
@alexanderjsingleton
alexanderjsingleton / phone-number-regex.gsheet
Last active May 28, 2016
Assuming column C contains different phone-number formats, insert the following regex in adjacent column D2 for uniform formatting.
View phone-number-regex.gsheet
=ArrayFormula(replace(replace(regexreplace(C2:C&"","[-/. ()]",""),4,0,"-"),8,0,"-"))
@alexanderjsingleton
alexanderjsingleton / plsql.sql
Last active May 13, 2016
A simple Oracle PL/SQL statement provided for [my blog-post on databases](https://www.alexanderjsingleton.com/event-horizon-data-centric-future)
View plsql.sql
-- An Oracle PL/SQL example for my blog-post:
CONNECT ap/ap;
SET SERVEROUTPUT ON
declare
min_invoice_total ap.invoices.invoice_total%TYPE;
max_invoice_total ap.invoices.invoice_total%TYPE;
begin
SELECT MIN(invoice_total), MAX(invoice_total) INTO min_invoice_total,max_invoice_total
FROM ap.invoices;
@alexanderjsingleton
alexanderjsingleton / joins.sql
Last active May 15, 2016
A simple JOINS statement provided for [my blog-post on databases](https://www.alexanderjsingleton.com/event-horizon-data-centric-future)
View joins.sql
-- A basic JOINS SQL statement resembling VLOOKUP
SELECT s.student_id,
z.state AS "STATE"
FROM STUDENT.STUDENT s
JOIN student.zipcode z ON s.zip=z.zip
ORDER BY s.STUDENT_ID;
You can’t perform that action at this time.