Skip to content

Instantly share code, notes, and snippets.

View donniebrandt's full-sized avatar
🐠
Being a goldfish

Donnie Brandt donniebrandt

🐠
Being a goldfish
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1EY4x3L4vhXra9H9tDJ37TUDG8vNVqUkpY https://explorer.blockstack.org/address/1EY4x3L4vhXra9H9tDJ37TUDG8vNVqUkpY
Verifying that "dbrandt.id" is my Blockstack ID. https://onename.com/dbrandt

Keybase proof

I hereby claim:

  • I am donniebrandt on github.
  • I am donnie (https://keybase.io/donnie) on keybase.
  • I have a public key whose fingerprint is 4CF9 E1FC 515C 12F1 008B 2764 60BA 5A49 B49A FAF9

To claim this, I am signing this object:

@donniebrandt
donniebrandt / states.sql
Last active August 29, 2015 14:04
MySQL: States.
CREATE TABLE `states` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`abbreviation` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
`country` enum('United States','Canada') COLLATE utf8_unicode_ci NOT NULL,
`region` enum('South','West','Northeast','Midwest') COLLATE utf8_unicode_ci NOT NULL,
`division` enum('East South Central','East North Central','West South Central','West North Central','New England','Pacific','Mountain','Middle Atlantic','South Atlantic') COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`name`,`country`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `states` (`name`, `abbreviation`, `country`, `region`, `division`)
@donniebrandt
donniebrandt / timezones.sql
Last active November 2, 2018 23:32
MySQL: Timezones.
CREATE TABLE `options` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`group` enum('Timezones') COLLATE utf8_unicode_ci NOT NULL,
`order` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`name`,`group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `options` (`name`, `group`, `order`)
VALUES
("Africa/Abidjan", 'Timezones', 0),
@donniebrandt
donniebrandt / into.sql
Last active December 28, 2015 06:09
MySQL: Select into.
INSERT INTO `target` (`column1`, `column2`)
SELECT `column1`, `column2` FROM `source`
WHERE `column1` > 0;
@donniebrandt
donniebrandt / distance.sql
Last active December 28, 2015 03:29
MySQL: Coordinates and distance.
SELECT
latitude,
longitude
(3959
* ACOS(COS(RADIANS(%.6f /*Lat*/))
* COS(RADIANS(latitude))
* COS(RADIANS(longitude) - RADIANS(%.6f /*Long*/)) + SIN(RADIANS(%.6f /*Lat*/))
* SIN(RADIANS(latitude)))) AS distance
FROM coordinates
WHERE latitude BETWEEN %.6f AND %.6f