Skip to content

Instantly share code, notes, and snippets.

View kaminskypavel's full-sized avatar
🐼
Engineer, I solve real-world problems with technology.

Pavel 'PK' Kaminsky kaminskypavel

🐼
Engineer, I solve real-world problems with technology.
View GitHub Profile
@kaminskypavel
kaminskypavel / init.lua
Last active December 9, 2023 07:23
PK's Neovim config
-- C:\Users\[username]\AppData\Local\nvim\init.lua
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Kickstart.nvim is *not* a distribution.
docker run -d --name mysql-employees -p 3306:3306 -e MYSQL_ROOT_PASSWORD=college -v data:/var/lib/mysql genschsa/mysql-employees
@kaminskypavel
kaminskypavel / renovate.json
Created January 16, 2020 06:23
renovate.json automerge
{
"extends": [
"config:base"
],
"packageRules": [
{
"updateTypes": [
"minor",
"patch",
"pin",
@kaminskypavel
kaminskypavel / script.js
Created August 19, 2019 15:08
lerna add multiple packages
// they say that laziness is the mother of all inventions
// lerna is currently not supporting multiple packages add (as mentioned here https://github.com/lerna/lerna/issues/1608)
// run this script and copy its output
'dotenv express cors ...put more of your packages here..'
.split(' ')
.map(e => `lerna add ${e} --scope=my-package --no-bootstrap`)
.join('\n')
@kaminskypavel
kaminskypavel / export-html-table-to-csv.js
Last active March 26, 2018 13:27
export HTML table to CSV
// based on table2CSV (https://github.com/rubo77/table2CSV) and https://gist.github.com/adilapapaya/9787842
// paste in console.
(function () {
jQuery.fn.table2CSV = function (options) {
var options = jQuery.extend({
separator: ',',
header: [],
headerSelector: 'th',
columnSelector: 'td',
@kaminskypavel
kaminskypavel / query.txt
Last active August 26, 2017 14:55
mysql range bucketing values
SET @bucketSize = 100;
select
a.bucketCeil,
CONCAT(a.bucketCeil, ' - ', a.bucketCeil) as bucket,
count(*) as count
from (
select
floor(d.value/@bucketSize)*@bucketSize as bucketFloor,
floor(d.value/@bucketSize)*@bucketSize + @bucketSize as bucketCeil