| Key | Result |
|---|---|
v |
select |
y |
copy (yank) |
c |
change |
d |
delete |
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
| await (async () => { | |
| const sheet_id = "SPREADSHEET_ID" // spreadsheet id | |
| const range = "SHEET!RANGE" // ie: Sheet1!A1:c100 | |
| const api_key = "APY_KEY" // insert your api key | |
| const url = `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}?key=${api_key}` | |
| const response = await fetch(url); | |
| const json = await response.json(); | |
| const values = json.values; | |
| const keys = values.shift(); | |
| const data = values.map(value => Object.fromEntries(keys.map((k, i) => [k,value[i]]))) |
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
| Array.from(document.getElementsByTagName("video"))[0].currentTime = 0 |
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 list = []; | |
| let targets = Array.from(document.querySelectorAll('*')); | |
| targets.push(document); | |
| targets.forEach((obj) => { | |
| let listeners = getEventListeners(obj); | |
| for (p in listeners) { | |
| listeners[p].forEach((l) => { | |
| removeEventListener(l.type, l.listener, l.useCapture); | |
| list.push([obj, l.type, l.listener, '' + l.listener, l.useCapture]); | |
| }); |
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
| document.querySelectorAll("trix-editor").forEach(el => { | |
| el.style.border = "1px solid green"; | |
| el.innerHTML = el.innerHTML.replaceAll("<div><!--block--><br></div>", "") | |
| el.innerHTML = el.innerHTML.replaceAll("<div><!--block--><br>","<div>") | |
| el.innerHTML = el.innerHTML.replaceAll("<br></strong><br>","</strong><br>"); | |
| el.innerHTML = el.innerHTML.replaceAll("<br></div>", "</div>") | |
| //console.log(el.innerHTML) | |
| }); |
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
| // https://darioamodei.com/subscribe | |
| // Shared typo corrections | |
| var commonTypos = { | |
| "gmail.con": "gmail.com", | |
| "gmail.co": "gmail.com", | |
| "gamil.com": "gmail.com", | |
| "gmai.com": "gmail.com", | |
| "yahoo.con": "yahoo.com", | |
| "yaho.com": "yahoo.com", |
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
| [10,2].forEach(function(row) { | |
| new Array(row).fill('').forEach((v, i) => { | |
| console.log([ | |
| ...new Array(9-i).fill('.'), | |
| ...new Array(1+i*2). fill('^'), | |
| ...new Array(9-i).fill('.') | |
| ].join('')); | |
| }); | |
| }); |
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
| function getCryptoValue( code="BTC-EUR", type='price' ) { // types= "price", "percent_change_24h" | |
| const properties = PropertiesService.getScriptProperties(); | |
| const coinmarketcap_api_key = properties.getProperty('coinmarketcap_api_key'); | |
| let value = 0 ; | |
| const options = { | |
| 'validateHttpsCertificates' : false, | |
| "headers" : { | |
| "X-CMC_PRO_API_KEY" : coinmarketcap_api_key, | |
| } | |
| }; |
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
| // bulk ignore riconcile, use this in console | |
| // https://secure.fattureincloud.it/importer/bankstatements | |
| const action = () => { | |
| const link1 = document.querySelectorAll("a[href='/importer/bankstatements']")[1]; | |
| link1.style.color = "blue"; | |
| link1.click(); | |
| setTimeout(() => { | |
| const link2 = document.querySelector("[id$='listItem']:last-child"); | |
| link2.style.color = "blue"; | |
| link2.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
| # CLI | |
| sudo apt update -y | |
| sudo apt install -y \ | |
| git curl docker.io \ | |
| build-essential pkg-config autoconf bison rustc cargo clang \ | |
| libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
| libvips imagemagick libmagickwand-dev \ | |
| redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
| rbenv apache2-utils |
NewerOlder