Skip to content

Instantly share code, notes, and snippets.

View nightkingdoms's full-sized avatar

NightKingdoms LLC nightkingdoms

View GitHub Profile
@nightkingdoms
nightkingdoms / countries-states.sql
Created April 5, 2014 06:51
Two tables: country table in UTF-8 listing all countries with a unique ID number, 2-digit country code and full country name; states table in UTF-8 listing all states/provinces with unique ID that are each cross-referenced to the country table by the country's ID number. This way you can directly reference each entity and cross reference them ap…
DROP TABLE IF EXISTS `countries`;
CREATE TABLE `countries` (
`id` int(11) NOT NULL auto_increment,
`country_code` varchar(2) NOT NULL default '',
`country_name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=240;
INSERT INTO `countries` VALUES (1, 'US', 'United States');
INSERT INTO `countries` VALUES (2, 'CA', 'Canada');
@nightkingdoms
nightkingdoms / survey.html
Last active May 28, 2017 11:52
Single Page, Configurable Survey
<!DOCTYPE html>
<html lang="en">
<head><title id="page-title"></title>
<!-- tell search engine robots not to follow -->
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta charset="utf-8">
<!-- prevent caching -->
<meta http-equiv="Pragma" content="no-cache">

Keybase proof

I hereby claim:

  • I am nightkingdoms on github.
  • I am soundwave (https://keybase.io/soundwave) on keybase.
  • I have a public key whose fingerprint is 68ED 6268 9A34 33A1 8E62 28B7 39DC 7262 5495 65E6

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am nightkingdoms on github.
  • I am nkx (https://keybase.io/nkx) on keybase.
  • I have a public key ASBfJf5qlCW5b6sVtiSs7hwrJzKzF2nRY6Vt7Gi5inw1hgo

To claim this, I am signing this object:

@nightkingdoms
nightkingdoms / kill_long_processes.php
Created November 28, 2023 22:19
Run with `php kill_long_processes.php` on command line to kill long running query processes in MySQL
<?php
$config = [
'db' => [
'host' => '',
'username' => '',
'password' => '',
'database' => '',
],
'max_time' => 300, // in seconds