Skip to content

Instantly share code, notes, and snippets.

View pkosiec's full-sized avatar

Pawel Kosiec pkosiec

View GitHub Profile
@pkosiec
pkosiec / botkube-k8s-source-extra-button.yaml
Last active July 27, 2023 07:06
Botkube Kubernetes source `extraButtons` configuration
k8s-err-events-with-ai-support: # Source configuration name
displayName: "Kubernetes Errors with AI support" # Source display name
botkube/kubernetes: # Kubernetes plugin configuration
# ...
config:
# ...
extraButtons:
- enabled: true
trigger:

Keybase proof

I hereby claim:

  • I am pkosiec on github.
  • I am pawelkosiec (https://keybase.io/pawelkosiec) on keybase.
  • I have a public key ASDvl3WH7enT4vOTgLcadLFN_CX8HrcHtfH6tYOJb-3Jvwo

To claim this, I am signing this object:

@pkosiec
pkosiec / array-example.js
Created November 1, 2018 22:35
MongoDB document definition examples
module.exports = [
{
name: "Dog"
},
{
name: "Cat"
}
]
@pkosiec
pkosiec / example-document.ts
Created November 1, 2018 22:21
Example MongoDB document in TypeScript
import { Person } from '../../models';
const people: Person[] = [
{
name: "John",
email: "john@mail.de",
age: 18,
},
{
name: "Bob",
emial: "bob@example.com", // <-- error underlined in IDE
@pkosiec
pkosiec / example-document-with-typo.json
Created November 1, 2018 22:19
Example MongoDB document with typo
[
{
"name": "John",
"email": "john@mail.de",
"age": 18,
},
{
"name": "Bob",
"emial": "bob@example.com",
"age": "none",
@pkosiec
pkosiec / example-document-with-randomization.js
Last active October 13, 2020 20:15
Example MongoDB document with randomization
const { getObjectId } = require("mongo-seeding");
const names = ["John", "Joanne", "Bob", "Will", "Chris", "Mike", "Anna", "Jack", "Peter", "Paul"];
const min = 18;
const max = 100;
module.exports = names.map(name => ({
firstName: name,
age: Math.floor(Math.random() * (max - min + 1)) + min,
_id: getObjectId(name),
}))
@pkosiec
pkosiec / example-document.js
Created November 1, 2018 22:16
Example import data in JS
const names = ["John", "Joanne", "Bob", "Will", "Chris", "Mike", "Anna", "Jack", "Peter", "Paul"];
module.exports = names.map(name => ({
name,
email: "example@example.com",
avatar: "https://placekitten.com/300/300",
}))
@pkosiec
pkosiec / example-documents.json
Created November 1, 2018 22:15
JSON is bad to define import data
[
{
"name": "John",
"email": "example@example.com",
"avatar": "https://placekitten.com/300/300"
},
{
"name": "Joanne",
"email": "example@example.com",
"avatar": "https://placekitten.com/300/300"
@pkosiec
pkosiec / example-document.json
Created November 1, 2018 22:14
Single MongoDB document definition
{
"name": "{NAME_HERE}",
"email": "example@example.com",
"avatar": "https://placekitten.com/300/300"
}
@pkosiec
pkosiec / custom-mongo-seeding.Dockerfile
Last active November 5, 2018 11:47
Custom Mongo Seeding Docker image example
FROM pkosiec/mongo-seeding:3.0.0
WORKDIR /mydb/
# Copy your project (import data and all dependencies have to be there)
COPY ./mydb /mydb/
# Install external dependencies
RUN npm install