Skip to content

Instantly share code, notes, and snippets.

@kitt-vl
kitt-vl / mysql database size
Created November 13, 2013 10:20
Show MySql databases size
SELECT table_schema 'database_name', sum( data_length + index_length )/1024/1024 'Data Base Size in MB' FROM information_schema.TABLES GROUP BY table_schema;
my @cart_items = $self->table->find(
where=>[ $self->_c->session_condition ],
with => [
{
name => 'Catalog.Image',
columns => [ 'url']
},
{
name => 'Catalog',
@kitt-vl
kitt-vl / wrong.sql
Last active October 15, 2018 06:02
SELECT "Cart"."unit",
"Cart"."price",
"Cart"."quantity",
"Cart"."summa",
"Cart"."catalog_id",
"Catalog"."url", -- <---Ooops =(
"Catalog_Image"."url",
"Catalog_Parent"."url_uniq"
FROM "Cart"
LEFT JOIN "Catalog" AS "Catalog" ON "Cart"."catalog_id" = "Catalog"."id"
@kitt-vl
kitt-vl / index.html
Created October 25, 2018 07:10
Bootstrap 4 visual XS|SM|MD|LG|XL helper (place this code in start of body tag)
<!-- Adopt colors and sizes at your favor -->
<div style="position: fixed; font-size: 32px; background: #36f21c; left: 0; top: 0; z-index: 9999;">
<span class="d-block d-sm-none">
XS
<br />
</span>
<span class="d-none d-sm-block d-md-none">
SM
<br />
</span>
@kitt-vl
kitt-vl / juick_b.pl
Created February 22, 2019 13:57
perl juick_b.pl login
use Mojo::Base -base;
use ojo;
my $link = shift;
my $url = 'https://juick.com/' . $link;
binmode STDOUT, ':utf8';
mkdir 'data' unless -d 'data';
while($url){
@kitt-vl
kitt-vl / juick_d.pl
Last active February 23, 2019 12:54
perl juick_d.pl login password
use Mojo::Base -base;
use ojo;
my ($link, $pass) = (shift,shift);
say "use $0 login password" and exit unless $link and $pass;
my $login = p('https://juick.com/login' => form => {username => $link, password => $pass});
say 'Auth failed' and exit unless $login->dom->at('div#ctitle a');
my $url = 'https://juick.com/' . $link;