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
#!/bin/bash -e | |
# vim: ts=2:et:tw=80 | |
# From: https://github.com/pseudocc/pseudosh/blob/main/utils.sh | |
# This script is a bash library that provides environment variables and functions | |
# for the common csi sequence. The csi sequence is the control sequence introducer | |
# that is used to control the terminal. | |
export BLACK=0 | |
export RED=1 |
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
/** | |
* @file eddystone_scanner.c | |
* @brief A C program to scan for Eddystone-URL beacons on Linux. | |
* | |
* This program uses the BlueZ library to perform a Bluetooth Low Energy scan, | |
* filter for Eddystone advertisement packets, decode the URL frame, and | |
* exits as soon as the first URL is found. This version uses recv() with a | |
* socket timeout instead of select(). | |
* | |
* @author Gemini |
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
/** | |
* umad.c - A simple uinput program to randomly generate input events | |
* including key presses, mouse movements. | |
* | |
* Author: 2024, Atlas Yu <atlas.yu@canonical.com> | |
* SPDX-License-Identifier: GPL-2.0 (inherited from linux/uinput.h) | |
* | |
* vim: ts=8 sw=8 noet | |
**/ |
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
#!/bin/bash | |
# vim: noet:ts=4:tw=80 | |
# Author: Atlas Yu <atlas.yu@canonical.com> | |
# Copyright: 2024 Canonical Ltd | |
# License: MIT | |
_info() { | |
>&2 echo "$@" | |
} |
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 "stdio.h" | |
#include "stdlib.h" | |
// assume running on little-endian machine | |
typedef union { | |
double direct; | |
struct __attribute__((packed)) { | |
unsigned long mantissa : 52; | |
signed exponent : 11; | |
unsigned sign : 1; |
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
const std = @import("std"); | |
fn worker_thread(mutex: *std.Thread.Mutex, accum: *u32, version: *u32) !void { | |
while (true) { | |
mutex.lock(); | |
defer mutex.unlock(); | |
accum.* += 1; | |
if (accum.* >= 100) { | |
version.* = 0; | |
break; |
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
[ | |
{ | |
"backcolor": "#ebebeb", | |
"name": "real-prog-dvorak", | |
"author": "Atlas Yu", | |
"background": { | |
"name": "PBT WCS", | |
"style": "background-image: url('/bg/plastic/pbt-wcs.png');" | |
} | |
}, |