This file contains 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
import {describe, expect, it, afterAll, afterEach, beforeAll, vi} from 'vitest' | |
import {render, screen, fireEvent} from '@testing-library/vue' | |
import {http, HttpResponse} from 'msw' | |
import {setupServer} from 'msw/node' | |
import {router} from "./services/route-config.ts"; | |
import App from './App.vue' | |
describe('Basic tests', () => { |
This file contains 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
import Database from 'better-sqlite3'; | |
import { desc, sql } from 'drizzle-orm'; | |
import { drizzle } from 'drizzle-orm/better-sqlite3'; | |
import { text, sqliteTable } from "drizzle-orm/sqlite-core"; | |
const sqlite = new Database('sqlite.db'); | |
const schema = { | |
UserTable: sqliteTable('user', { | |
name: text('name').notNull() |
This file contains 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
# completion tools to add into .bashrc | |
source <(k0s completion bash) | |
source <(kind completion bash) | |
source <(helm completion bash) | |
source <(argocd completion bash) | |
source <(kubectl completion bash) | |
source <(npm completion) | |
source <(gh completion -s bash) |
This file contains 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
#!/usr/bin/env bash | |
export RESULT=-1 | |
until [ $RESULT -eq 0 ]; do | |
sleep 3; | |
echo "attempt to create keyspace" | |
cqlsh cassandra-local \ | |
-u cassandra \ | |
-p cassandra \ | |
-e "create keyspace if not exists my_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};" | |
RESULT=$? |
This file contains 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
import { readFileSync } from 'node:fs'; | |
import { logger } from './logging.js'; | |
const log = logger.scope('no-rollback.js'); | |
/** | |
* Apply database migrations | |
* | |
* @param {import('@electric-sql/pglite')} database database connection instance | |
*/ |
This file contains 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
#!/bin/sh | |
# need to run this to have a proper local cluster | |
sleep 5 ; echo yes | redis-cli --cluster create redis-7003:7003 redis-7001:7001 redis-7002:7002 --cluster-replicas 0 |
This file contains 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
<!-- | |
Since the markup IS the application state, using data-* attributes to keep track of some specifics would be handy. | |
Luckily, HTMX is brutally easy to extend, so we can do that in no time! | |
--> | |
<article class="message task" | |
th:id="'task'+${task.id}" | |
th:data-task="${task.id}" | |
th:data-status="${task.status.id}" | |
th:hx-put="@{/task/{id}(id=${task.id})}" | |
hx-ext="hx-dataset-include" |
This file contains 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
package sample.example | |
import org.hamcrest.CoreMatchers | |
import org.hamcrest.MatcherAssert | |
import org.junit.jupiter.api.Assertions | |
import org.junit.jupiter.api.Test | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.context.SpringBootTest | |
import org.springframework.context.annotation.Import | |
import org.springframework.data.domain.PageRequest |
This file contains 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
version: "3.8" | |
services: | |
elasticsearch: | |
image: pelias/elasticsearch:7.16.1 | |
restart: always | |
ports: [ "127.0.0.1:9200:9200", "127.0.0.1:9300:9300" ] | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 |
This file contains 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
export class Logging { | |
static async generalLogger (ctx, next) { | |
try { | |
await next() | |
} catch (err) { | |
console.log(err) | |
ctx.throw(err) | |
} | |
} | |
} |
NewerOlder