Skip to content

Instantly share code, notes, and snippets.

🐼
Engineer, I solve real-world problems with technology.

Pavel 'PK' Kaminsky kaminskypavel

🐼
Engineer, I solve real-world problems with technology.
Block or report user

Report or block kaminskypavel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kaminskypavel
kaminskypavel / script.js
Created Aug 19, 2019
lerna add multiple packages
View script.js
// 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')
View export-html-table-to-csv.js
// 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 Aug 26, 2017
mysql range bucketing values
View query.txt
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
You can’t perform that action at this time.