Skip to content

Instantly share code, notes, and snippets.

View bananu7's full-sized avatar
🏍️

Bartek Banachewicz bananu7

🏍️
View GitHub Profile
fn b_to_s(bytes: &[u8]) -> String {
let hex : String = bytes.iter()
.map(|b| format!("{:02x}", b).to_string())
.collect::<Vec<String>>()
.join("");
hex
}
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js';
document.head.appendChild(script);
const url = '/filebrowser/api/raw/230827_095441/TRACK07.m4a?auth=...'
const audioElement = document.createElement('audio');
audioElement.src = url;
document.body.appendChild(audioElement);
@property --x {
syntax: '<percentage>';
inherits: false;
initial-value: 0%;
}
@keyframes colorChange {
0% {
--x:0%;
}
const Hex = (props) => {
const canvasRef = React.useRef(null);
React.useEffect(() => {
const a = (2 * Math.PI) / 6;
const r = 40;
const canvas = canvasRef.current;
const ctx = canvas.getContext("2d");
<html>
<head>
<style>
body { background-color: #29a; }
.bubble {
border-radius: 50%;
border: 3px solid black;
width: 50px;
height: 50px;
@bananu7
bananu7 / bank.cpp
Last active September 28, 2021 08:16
Szkolenie C++ 2021-09-27
#include <thread>
#include <ranges>
#include <mutex>
#include <array>
#include <iostream>
#include <chrono>
#include <map>
#include <format>
#include <random>
ISO-10303-21;
HEADER;
/* Generated by software containing ST-Developer
* from STEP Tools, Inc. (www.steptools.com)
*/
/* OPTION: strings as raw bytes, not using required /X/ escapes */
FILE_DESCRIPTION(
/* description */ ('Unknown'),
/* implementation_level */ '2;1');
version: '3'
services:
cockroachdb:
container_name: cockroachdb
image: cockroachdb/cockroach:latest-v20.2
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
restart: "no"
volumes:
- data:/var/lib/cockroach
expose:
@bananu7
bananu7 / vwcdc.c
Last active February 3, 2021 18:32
The code for VW Gamma V radio unlock (CD changer emulation)
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>
#include <SPI.h>
//#define pSS
#define pDATA 0b00001000
#define pCLK 0b00100000
@bananu7
bananu7 / blackwidow.py
Created January 31, 2021 13:18
The fixed blackwidow.py script. Use Zadig and libusb
#!/usr/bin/python
"""This is a patched version of Sergey's code form
https://superuser.com/a/474595/8647
It worked for my Razer BlackWidow 2013 Mechanical Gaming Keyboard
(Model Number: RZ03-0039).
"""
import usb