Skip to content

Instantly share code, notes, and snippets.

SELECT
th.PROCESSLIST_ID,
th.NAME,
th.TYPE,
th.PROCESSLIST_STATE,
th.PROCESSLIST_INFO,
th.PROCESSLIST_TIME,
dl.OBJECT_SCHEMA,
dl.OBJECT_NAME,
dl.LOCK_MODE,
// Videos list type and list of views for the chart
type Videos struct {
ListType string
VideoViews []struct {
Id string `json:"id"`
Title string `json:"title"`
ViewCount string `json:"viewCount"`
Thumbnail map[string]interface{} `json:"thumbnail"`
VideoDuration float64 `json:"videoDuration"`
ChannelId string `json:"channelId"`
@dathan
dathan / top200.sql
Last active January 27, 2018 18:09
CREATE TABLE `top200` (
`artist` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`track` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`country` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`list_date` date NOT NULL DEFAULT '0000-00-00',
`pos` smallint(5) unsigned NOT NULL DEFAULT '0',
`streams` bigint(20) unsigned NOT NULL DEFAULT '0',
`stream_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`artist`,`track`,`country`,`list_date`),
KEY `country-list_date` (`country`,`list_date`)
@dathan
dathan / Dockerfile
Created January 19, 2018 20:35
Dockerfile example for mysqldba.blogspot.com
FROM scratch #this line in the dockerfile says in essence inherit from scratch
COPY . /app #copy the binary to the container's /app directory
WORKDIR /mnt #when executing the binary the cwd in the container is /mnt
EXPOSE 8282 #expose port 8282 to the host
CMD ["/a
CREATE TABLE `platform_resources` (
`platform` varchar(20) NOT NULL DEFAULT '' COMMENT 'facebook,youtube,twitter',
`platform_id` varchar(50) NOT NULL DEFAULT '0' COMMENT 'The social networks id',
`internal_name` varchar(50) NOT NULL DEFAULT '' COMMENT 'How we identify people',
`create_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'when the row was added',
`update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, COMMENT 'last time we updated the totals'
`likes` int(10) unsigned DEFAULT NULL,
`dislikes` int(10) unsigned DEFAULT NULL,
`comments` int(10) unsigned DEFAULT '0',
`views` int(10) unsigned DEFAULT NULL,
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
socket = /var/lib/mysql/mysql.sock
@dathan
dathan / gist:4ff8554e1a4e20eb71e4
Created August 5, 2015 18:41
Shows a bunch of content in the list but will only render rudy's photo
{
"status": "success",
"items": [
{
"resource": {
"type": "photo",
"id": "28111185",
"user_id": "17629288",
"width": "960",
"height": "1280",