Skip to content

Instantly share code, notes, and snippets.

@xTibor
xTibor / main.rs
Created February 11, 2017 23:52
Gradient Test Application
extern crate orbclient;
use orbclient::{Color, Window, Renderer, EventOption};
fn render(window: &mut Window, px: i32, py: i32) {
let color_start = Color::rgb(0, 0, 0);
let color_end = Color::rgb(255, 255, 255);
let color_line = Color::rgb(255, 0, 0);
let (cx, cy) = (300, 300);
@xTibor
xTibor / Cargo.toml
Last active February 18, 2017 13:23
New widget style experiments
[package]
name = "gradientgui"
description = "Experimental app"
repository = "https://github.com/redox-os/orbutils"
version = "0.0.1"
license-file = "LICENSE"
readme = "README.md"
authors = ["Tibor Nagy <xnagytibor@gmail.com>"]
[[bin]]
fn mlx_checksum(address: usize, data: &[u8]) -> u8 {
let mut checksum = address as isize / 256;
checksum = address as isize - 254 * checksum - (if checksum > 127 { 255 } else { 0 });
if checksum > 255 { checksum -= 255; }
for i in 0..8 {
checksum = checksum * 2 - (if checksum > 127 { 255 } else { 0 }) + data[i] as isize;
if checksum > 255 { checksum -= 255; }
}
checksum as u8
program EszEd;
{ TODO: Error handling where neccessary. }
const
CCategoryCount = 11;
CCategories: array[1..CCategoryCount] of string = (
'SZOLAS', { Saying }
'FOGALOM', { Concept }
'SZEMELY', { Person }
@xTibor
xTibor / main.c
Last active December 31, 2019 11:23
Compiler warnings/lints test case for "Why It's Already 2020"
#include <stdio.h>
#include <time.h>
/*
Compiler warnings/lints test case for "Why It's Already 2020":
https://www.youtube.com/watch?v=D3jxx8Yyw1c
*/
#define BUFSIZE 256
@xTibor
xTibor / gist:efb06867d5c0fdf25516b41e2e90a18c
Created February 27, 2020 12:01
kdeconnect sftp mount fail
kdeconnect.plugin.sftp: Process started
kdeconnect.plugin.sftp: "Galaxy J3" "Remote filesystem mounted at /run/user/1000/2a7e26c695c6035d"
kdeconnect.plugin.sftp: stdout: "Warning: Permanently added '[192.168.1.102]:1741' (RSA) to the list of knownhosts.\r\n"
kdeconnect.plugin.notification: Destroying NotificationsPlugin
kdeconnect.plugin.sftp: Destroy mounter
kdeconnect.plugin.sftp: Unmount KProcess(0x556a48f3ebe0)
kdeconnect.plugin.sftp: Free KProcess(0x556a48f3ebe0)
@xTibor
xTibor / google-foobar.txt
Last active March 8, 2021 02:57
Google Foobar
Python version:
2.7.16, not 2.7.13 as constraints.txt states
Host:
Some kind of Linux
socket.gethostname():
localhost
BLACKLISTED_CODE circumvention:
$ aseqdump --port 28:0
[Play button]
28:0 Control change 15, controller 106, value 127
28:0 Control change 15, controller 106, value 0
[Record button]
28:0 Control change 15, controller 107, value 127
28:0 Control change 15, controller 107, value 0
$ timidity -iA -Os -B 2,9
$ aseqdump
$ aseqmatrix
aseqmatrix:
Passthrough -> timidity
Passthrough -> aseqdump
$ aplaymidi midi.mid --port 14:0
@xTibor
xTibor / style.css
Last active November 16, 2022 19:03
Revert GitHub font change 2022/11/16
body, .markdown-body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
}