Skip to content

Instantly share code, notes, and snippets.

View andrewrcollins's full-sized avatar

Andrew Collins andrewrcollins

View GitHub Profile
@andrewrcollins
andrewrcollins / mysql-pool.sh
Created October 29, 2023 16:36
Implements connection pool for MySQL connections.
#!/bin/sh
#
# mysql-pool.sh
#
# Implements connection pool for MySQL connections.
#
##### start script name
@andrewrcollins
andrewrcollins / ssh-pool.sh
Created October 29, 2023 16:31
Implements connection pool for SSH connections.
#!/bin/sh
#
# ssh-pool.sh
#
# Implements connection pool for SSH connections.
#
##### start script name
@andrewrcollins
andrewrcollins / warm-up.sh
Created October 29, 2023 16:28
Perform "warm up" on MySQL database tables.
#!/bin/sh
#
# warm-up.sh
#
# Perform "warm up" on database tables.
#
#####
@andrewrcollins
andrewrcollins / soybeans.txt
Created February 15, 2020 00:38
Soybeans: Global Production and Usage
'
' Soybeans: Global Production and Usage
'
' Build a Sankey Diagram
' http://sankeymatic.com/build/
'
' SankeyMATIC Manual
' http://sankeymatic.com/manual/
'
' node colors
@andrewrcollins
andrewrcollins / eyewitness.io
Created January 2, 2018 18:18
eyewitness.io
https://eyewitness.io/
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Adrian Stubblefield', '2013-09-11', 57, 0);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Marcus Duck', '1966-08-22', 77, 0);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Ngan Rome', '1974-11-29', 78, 0);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Marguerita Poythress', '1966-07-15', 63, 0);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Millie Pipes', '1975-06-24', 67, 0);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Merlin Lacoste', '2007-11-05', 77, 1);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Kam Benware', '2013-07-15', 55, 1);
INSERT INTO `person` (`id`, `name`, `birthday`, `height`, `wears_glasses`) VALUES (NULL, 'Kristal Dement', '1975-09-24', 76
@andrewrcollins
andrewrcollins / person_friendship_team_membership.sql
Last active November 15, 2017 19:30
Person, Friendship, Team, and Membership
DROP TABLE IF EXISTS `person`;
DROP TABLE IF EXISTS `friendship`;
DROP TABLE IF EXISTS `team`;
DROP TABLE IF EXISTS `membership`;
CREATE TABLE `person` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`birthday` DATE NOT NULL,
`height` int NOT NULL,
@andrewrcollins
andrewrcollins / tag.sql
Created April 10, 2017 02:21
simple tagging
CREATE TABLE tag
(
id INT(10) unsigned NOT NULL auto_increment,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY tag_name (name)
);
CREATE TABLE tag_type
(
var distance = require('euclidean-distance')
var lerp = require('lerp')
var pts = [[0, 0], [1, 4], [2, 9], [3, 2], [2, 0]]
//console.log(pts)
var distances = []
var sum = []
<?php
/**
* First Code Sample.
*
* Make a class which you would pass the components of someone's name
* (first name, last name) to the constructor, and have two functions
* callable off of the object:
*
* 1. Simply print out the whole name, i.e. "John Smith"