<form
id="keyword_suggestions_form"
hx-post="/api/v2/keyword_suggestions"
hx-target="#keywords_container"
hx-indicator="#loader_container"
hx-on:htmx:before-request="emptyDiv('#keywords_container')"
hx-trigger="submit[!isFieldEmpty('#seed_keyword')], submitKeywordSearch from:body"
>
<input type="hidden" name="search_type" id="search_type" value="all_terms">
</form>
<div
hx-get="/api/v1/pending_articles_count"
hx-trigger="every 30s"
hx-select="#pending_articles_count_content"
hx-target="this"
class="header-menu">
<!--tips: use hx-select to only target the div, and not whole partial -->
<span class="font-light">Generating</span>
</div>
<form
id="keyword_suggestions_form"
hx-post="/api/v2/keyword_suggestions"
hx-target="#keywords_container"
hx-indicator="#loader_container"
hx-on:htmx:before-request="emptyDiv('#keywords_container')"
hx-trigger="submit[!isFieldEmpty('#seed_keyword')]"
>
<input type="hidden" name="search_type" id="search_type" value="all_terms">
</form>
inicio{
"host":"0E0272FD483D2926380E66AAAFB1BC",
"porta":"473D2C"
}fim
inicio{
"host":"2B1E1612241E0A7FD877FD1C39",
"porta":"47C2BABA"
}fim
npx tailwindcss -i ./src/input.css -o ./src/output.css --watch
/**
* @param {number[][]} grid
* @return {number[][]}
*/
var largestLocal = function(grid) {
// Get the size of the grid
let n = grid.length;
// Initialize the result matrix with size (n - 2) x (n - 2)
let maxLocal = Array(n - 2).fill().map(() => Array(n - 2).fill(0));
// Iterate over the grid, excluding the border
for (let i = 1; i < n - 1; i++) {
for (let j = 1; j < n - 1; j++) {
// Initialize the max value as the smallest possible number
Listar todos los contenedores activos
```
docker ps
```
Activar todos los contenedores de una carpeta
- Ir a la carpeta donde estan los contenedores
```
cd-docker
```
- Poner el comando
```
docker-compose up -d
```
Detener todos los contenedores
```
docker stop $(docker ps -q)
```
-- https://towardsdev.com/sql-case-statement-with-code-examples-04f77dab8d5a
-- 1. Simple case
SELECT
order_id,
CASE customer_id
WHEN 1 THEN 'Premium'
WHEN 2 THEN 'Gold'
WHEN 3 THEN 'Silver'
ELSE 'Regular'
END AS customer_type
FROM orders;
-- 2. Searched CASE Statement
SELECT
order_id,
CASE
WHEN order_amount > 1000 THEN 'High'
WHEN order_amount > 500 THEN 'Medium'
ELSE 'Low'
END AS order_priority
FROM orders;
--
<hgroup>
<h1>タイトル</h1>
<p>サブタイトル</p>
</hgroup>
// Composable
const useBurger = () => {
const lettuce = ref(true);
const ketchup = ref(true);
return {
lettuce,
ketchup,
}
// Component
setup() {
// We can destructure but still keep our reactivity
const { ketchup } = useBurger();
watchEffect(() => console.log(ketchup.value));
return {
ketchup,
removeKetchup: () => ketchup.value = false
};
}
// If you don't want to destructure the values, you can always wrap it in reactive and it
// will be converted to a reactive
/**
* @param {number[]} quality
* @param {number[]} wage
* @param {number} k
* @return {number}
*/
var mincostToHireWorkers = function(quality, wage, k) {
// Create an array of workers, where each worker is represented as an array of [quality, wage]
let workers = [];
for (let i = 0; i < quality.length; i++) {
workers.push([quality[i], wage[i]]);
}
// Sort the workers array by wage to quality ratio in ascending order
workers.sort((a, b) => (a[1] / a[0]) - (b[
Al poner **trailingSlash** como **true**, se añadira el slash al final de las URLs.
Archivo: next.config.mjs
```js
/** @type {import('next').NextConfig} */
const nextConfig = {
trailingSlash: true,
};
export default nextConfig;
```
// Destructure into multiple variables
const obj = { val: 1 };
const { val: a, val: b, val } = obj;
console.log(a); // -> 1
console.log(b); // -> 1
console.log(val); // ->
// Chaining catch in Promise
const somePromise = async () => Promise.reject('error');
somePromise()
.then(e => {
//
})
.catch(e => {
throw new Error('error happened');
})
.catch(e => {
console.log('hi ' + e); // hi Error
});
// Multiple handlers for
Different SQL database management systems have their own mechanisms and syntax
for automatically incrementing primary keys:
## 1. SQLite: Uses `AUTOINCREMENT` with `INTEGER PRIMARY KEY`
```sql
CREATE TABLE table_name (
id INTEGER PRIMARY KEY AUTOINCREMENT,
...
);
```
## 2. MySQL uses `AUTO_INCREMENT` with `INT`
```sql
CREATE TABLE table_name (
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
...
);
```
## 3. PostgreSQL uses serial types like `SERIAL` for auto-incrementin