-- EXCLUDE: remove columns from SELECT *
SELECT * EXCLUDE (id, created_at) FROM users
-- REPLACE: modify specific columns, keep others
SELECT * REPLACE (price * 1.1 AS price) FROM products
- For marimo notebooks: See
MARIMO_RULES.md
for specific marimo conventions
BEFORE writing ANY marimo cell, check:
- Are you putting
mo.md()
,mo.ui.table()
, or ANY display function insideif
,try
,for
,while
, orwith
blocks? - If YES → STOP! You must prepare content inside control blocks, then display OUTSIDE them.
Template pattern:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (let step = 0; step < 3; step++) {$("span[title='Previous']").click();$("span[data-icon='download']").click()} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let searchBox = document.querySelector(".searchBox"); | |
let filterSearch, nav, linkCollection; | |
function processResults() { | |
{#input = document.getElementById("mySearch");#} | |
filterSearch = searchBox.value.toUpperCase(); | |
nav = document.querySelector(".leftnav"); | |
linkCollection = nav.getElementsByClassName("menuitem"); | |
Array.from(linkCollection).forEach(element => { | |
if (element.innerHTML.toUpperCase().indexOf(filterSearch) > -1) { | |
element.style.display = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# troubleshoot pdf generation | |
xelatex -no-pdf main # run xetex only | |
xdvipdfmx -E -vv main.xdv # this shows pontential issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks = []; | |
$$(".body-content .row").forEach(function(row) { | |
rowData = []; | |
im = $$("img",row); | |
sub = ''; | |
if(im[0]){ | |
sub = im[0].src | |
rowData.push(sub) | |
$$("div",row).forEach(function(div) { | |
rowData.push(div.innerText) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
see how is the field saved / tokenized in elastic | |
{ | |
"query": { | |
"term": { | |
"sku": "2306" | |
} | |
}, | |
"script_fields": { | |
"terms": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TTFB with curl | |
curl -o /dev/null -s -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://www.google.com/webmasters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- generate alter table to change default values on columns from previous MySQL version | |
select | |
-- TABLE_NAME, COLUMN_NAME, | |
-- column_type, | |
concat('ALTER TABLE ', table_name, ' CHANGE ', COLUMN_NAME, ' ', COLUMN_NAME, ' ', column_type,' NOT NULL DEFAULT ',if( COLUMN_DEFAULT = '0000-00-00', "'1000-01-01';", "'1000-01-01 00:00:00';")) alt | |
from information_schema.columns | |
where table_schema = 'sourcedb' | |
and COLUMN_DEFAULT in ('0000-00-00 00:00:00', '0000-00-00') | |
order by table_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show running virtual machines | |
# https://www.virtualbox.org/manual/ch08.html#vboxmanage-list | |
VBoxManage list runningvms | |
# cleanup - list all vms, delete by name (checking the list of folders for date modified can help :) | |
VBoxManage list vms | |
VBoxManage unregistervm --delete XXX (name or uid) | |
# show what vagrant has running | |
vagrant global-status |
NewerOlder