This file contains hidden or 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
| # Prints a tiny orange image, using Kitty Graphics Protocol and a PNG | |
| # Tested in Konsole and Kitty | |
| # Image licensed as CC0 | |
| print('\x1b_Ga=T,f=100;iVBORw0KGgoAAAANSUhEUgAAAAoAAAAPCAYAAADd/14OAAAAAXNSR0IArs4c6QAAAJpJREFUKJFjZMADVIKs/8PYjPgUmeb/YmBgYGA4PZENu0J0RXfWHWVkwWXi6YlsDAwMDAx31h1lxLDaWlz1PzL/6MvbcHlGZEX7er6hmOpUwgVXzIhLEbpiRnyKGBgYGBiPv2dwXCvNwIRTBRqgjkLG4+8JK0RWxMCAw9fIihzXSkN8DROwFlf9vz/4KYopMEVwE5EVI/ORYwYAW+BBDZRW2fwAAAAASUVORK5CYII=\x1b\\') |
This file contains hidden or 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 | |
| SERVER="$1" | |
| TIMEOUT="$2" | |
| TIMEOUT=${TIMEOUT:-600} | |
| if [ -z "$SERVER" ]; then | |
| echo -e "\e[31m[!] Usage: bash client.sh [HOST] [Optional curl timeout]\e[0m\n" | |
| exit 0 | |
| fi | |
| curl --silent --max-time $TIMEOUT -X POST --data 'Hello, hacker!' $SERVER |
This file contains hidden or 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
| use fontdue::layout::Layout; | |
| use rayon::{prelude::*, slice::ParallelSliceMut}; | |
| #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] | |
| pub struct Color { | |
| pub r: u8, | |
| pub g: u8, | |
| pub b: u8, | |
| } |
This file contains hidden or 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
| { | |
| inputs = {}; | |
| outputs = { nixpkgs, ... }: let | |
| system = "x86_64-linux"; | |
| pkgs = import nixpkgs { inherit system; }; | |
| in { | |
| devShells.${system}.default = pkgs.mkShell { | |
| buildInputs = with pkgs; [ | |
| hello | |
| ]; |
This file contains hidden or 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
| from risdk import * | |
| # Создание компонента i2c адаптера модели ch341 | |
| i2c = I2CAdapter("ch341") | |
| # Создание компонента ШИМ модели pca9685 | |
| pwm = PWM("pca9685") | |
| # Создание компонента сервопривода модели mg90s | |
| servo = Servodrive("mg90s") |
This file contains hidden or 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
| use raylib::prelude::*; | |
| pub fn update_camera(rl: &RaylibHandle, camera: &mut Camera3D, mouse_delta: Vector2) { | |
| let speed = 5.0; | |
| let sensivity = 0.003; | |
| { | |
| // Rotate | |
| camera.target = (camera.target - camera.position).rotate_by(Quaternion::from_axis_angle( | |
| camera.up, |
This file contains hidden or 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
| // Thanks to https://gist.github.com/flaminggoat/6106ef29de5df367fb907cf05c363c17 | |
| use std::{ffi::c_int, ptr::null_mut}; | |
| #[allow(dead_code)] | |
| pub fn setup_sd() { | |
| const SDMMC_HOST_FLAG_1BIT: u32 = 1 << 0; // host supports 1-line SD and MMC protocol | |
| const SDMMC_HOST_FLAG_4BIT: u32 = 1 << 1; // host supports 4-line SD and MMC protocol | |
| const SDMMC_HOST_FLAG_8BIT: u32 = 1 << 2; // host supports 8-line MMC protocol | |
| const SDMMC_HOST_FLAG_SPI: u32 = 1 << 3; // host supports SPI protocol | |
| const SDMMC_HOST_FLAG_DDR: u32 = 1 << 4; // host supports DDR mode for SD/MMC |
This file contains hidden or 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
| #include <imgui.h> | |
| #include <GL/OOGL.hpp> | |
| #include <backends/imgui_impl_opengl3.h> | |
| #include <unordered_map> | |
| // clang-format off | |
| const std::unordered_map<GL::Key::key_t, ImGuiKey> keymap = { | |
| {GL::Key::F1, ImGuiKey_F1}, {GL::Key::F2, ImGuiKey_F2}, {GL::Key::F3, ImGuiKey_F3}, {GL::Key::F4, ImGuiKey_F4}, {GL::Key::F5, ImGuiKey_F5}, {GL::Key::F6, ImGuiKey_F6}, | |
| {GL::Key::F7, ImGuiKey_F7}, {GL::Key::F8, ImGuiKey_F8}, {GL::Key::F9, ImGuiKey_F9}, {GL::Key::F10, ImGuiKey_F10}, {GL::Key::F11, ImGuiKey_F11}, {GL::Key::F12, ImGuiKey_F12}, |
NewerOlder