Skip to content

Instantly share code, notes, and snippets.

View SerendipityNL's full-sized avatar
🍌

Douwe de Haan SerendipityNL

🍌
View GitHub Profile
@SerendipityNL
SerendipityNL / queries.sql
Created January 21, 2020 09:04
To calculate and plot the average amount of queries per pageview per month
-- Upload to https://chart-studio.plot.ly/create
SELECT
`date`,
`amount` / `pageviews` AS `queries_per_page`
FROM
`log_queries`;
SELECT
`date`,
AVG(`amount` / `pageviews`) AS `queries_per_page`
@SerendipityNL
SerendipityNL / MySQL.md
Last active January 7, 2020 13:12
Terminal functions

Extract a gzip file and import the result into a locally hosted database

function import_gzip_to_mysql {
  read "gzipfilename?gzip filename [~/Development/database.gz]: "
  gzipfilename=${gzipfilename:-~/Development/database.gz}
  read "database?Target database: "
  pv $gzipfilename | gunzip | mysql -u root --password=root $database
}
@SerendipityNL
SerendipityNL / Readme.md
Last active May 29, 2019 13:38
Laravel AdminLTE Sidebar Toggle Cookie

This is Ardziej's solution:

JS

$.AdminLTESidebarTweak = {};

$.AdminLTESidebarTweak.options = {
    EnableRemember: true,
    NoTransitionAfterReload: false
    //Removes the transition after page reload.