Skip to content

Instantly share code, notes, and snippets.

@kwdowicz
kwdowicz / shelter_display.ino
Created March 23, 2026 07:37
shelter_display.ino
/*
Jak podłączyć OLED do Arduino Nano
To bardzo proste połączenie. Ekran ma cztery wyprowadzenia:
GND łączysz z pinem GND w Nano
VCC łączysz z pinem 5V w Nano
SDA łączysz z analogowym pinem A4 w Nano (to sprzętowa linia danych I2C)
// PIN CONFIGURATION: ROOMS
const int flickerPin1 = 3;
const int flickerPin2 = 5;
const int flickerPin3 = 6;
const int stablePin1 = 9;
const int stablePin2 = 10;
const int stablePin3 = 11;
// PIN CONFIGURATION: ELEVATOR (Digital pins without PWM)
const int elevPin1 = 4;
@kwdowicz
kwdowicz / builder_pattern.rs
Created July 7, 2024 22:09
builder pattern in rust
use crate::Topping::{Ham, Pepper, Pineapple};
#[derive(Debug)]
enum Topping {
Peperoni,
Ham,
Pineapple,
Oregano,
Pepper,
}
use rdkafka::config::ClientConfig;
use rdkafka::consumer::{Consumer, StreamConsumer, CommitMode};
use rdkafka::message::{Message, BorrowedMessage};
use futures::stream::StreamExt;
use tokio;
#[tokio::main]
async fn main() {
let consumer: StreamConsumer = ClientConfig::new()
.set("group.id", "test-group")
@kwdowicz
kwdowicz / Cargo.toml
Created May 11, 2024 21:18
Basic but cool Rust logging
[dependencies]
chrono = "0.4.38"
fern = "0.6.2"
log = "0.4.21"
*****************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. RW1.
AUTHOR. Kamil Wdowicz.
*
* Example on how to read from and write to files.
*
*****************************************************************
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
//RW1 JOB ,MSGLEVEL=(2,1)
//EXP EXPORT SYMLIST=*
//SETNAME SET MEM=RW1
//***************************************************/
//DELETE EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DELETE (OUT)
/*
//***************************************************/
@kwdowicz
kwdowicz / q3config.cfg
Created August 15, 2023 15:19
q3config.cfg
// generated by quake, do not modify
unbindall
bind TAB "+scores"
bind ENTER "+button2"
bind ESCAPE "togglemenu"
bind SPACE "+moveup"
bind + "sizeup"
bind - "sizedown"
bind / "weapnext"
bind 0 "weapon 10"
@kwdowicz
kwdowicz / gist:1974703
Created March 4, 2012 20:40
jeszcze jeden z gaff-a (linode) - z mojego kompa ab sie timeoutuje
mamut@li302-202:~$ ab -n 3000 -c 1000 http://btmagic.com:88/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking btmagic.com (be patient)
Completed 300 requests
Completed 600 requests
Completed 900 requests
Completed 1200 requests
@kwdowicz
kwdowicz / moj_ab01
Created March 4, 2012 20:34
z mojego kompa
➜ ~ ab -n 3000 -c 1000 http://btmagic.com:88/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking btmagic.com (be patient)
apr_poll: The timeout specified has expired (70007)