This file contains 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
// Variant of https://github.com/GNOME/pango/blob/main/examples/cairotwisted.c to shape text a bit trapezoidal | |
/* Example code to show how to use pangocairo to render text | |
* projected on a path. | |
* | |
* | |
* Written by Behdad Esfahbod, 2006..2007 | |
* | |
* Permission to use, copy, modify, distribute, and sell this example | |
* for any purpose is hereby granted without fee. |
This file contains 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
[package] | |
name = "foo" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
reqwest = { version = "0.11", features = ["blocking"] } | |
vfs-zip = "0.2.1" |
This file contains 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 std::collections::HashMap; | |
use std::marker::PhantomData; | |
use std::sync::Arc; | |
use tokio::io::{AsyncReadExt as _, AsyncWriteExt as _}; | |
use tokio::sync::mpsc::{ | |
channel, unbounded_channel, OwnedPermit, Receiver, Sender, UnboundedReceiver, | |
}; | |
use tokio::sync::Mutex; | |
use x11rb::connection::SequenceNumber; | |
use x11rb::errors::{ConnectionError, ParseError}; |
This file contains 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
/* | |
* A simple client icon that "does nothing". | |
* | |
* Copyright © 2021 Uli Schlachter <psychon@znc.in> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* |
This file contains 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 <cairo.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <xcb/xcb.h> | |
static cairo_region_t *unobscured_space( | |
xcb_connection_t *conn, | |
xcb_window_t window, | |
uint16_t width, | |
uint16_t height) { |
This file contains 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/python3 | |
import select | |
import socket | |
import sys | |
import time | |
class Listener: | |
def __init__(self, listen_port, target_port, delay): |
This file contains 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 std::io::{Error as IOError, ErrorKind, Read, Write}; | |
use std::net::{TcpListener, TcpStream}; | |
use std::os::unix::net::UnixStream; | |
use std::thread; | |
use std::env::args_os; | |
use std::process::Command; | |
use std::convert::{TryFrom, TryInto}; | |
use std::sync::{Arc, Mutex}; | |
use std::collections::VecDeque; |
This file contains 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 std::os::unix::net::UnixStream; | |
use std::os::unix::io::AsRawFd; | |
use std::io::{Read, Result as IOResult, Write}; | |
use std::error::Error; | |
use std::convert::TryFrom; | |
use nix::poll::{PollFd, PollFlags, poll}; | |
use x11rb::protocol::xproto::{self, SetupRequest, Setup}; | |
use x11rb::x11_utils::Serialize; |
This file contains 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
diff --git a/tests/test-benchmark.lua b/tests/test-benchmark.lua | |
index 61e4c4e54..4f6a05ace 100644 | |
--- a/tests/test-benchmark.lua | |
+++ b/tests/test-benchmark.lua | |
@@ -77,6 +77,129 @@ benchmark(relayout_textclock, "relayout textclock") | |
benchmark(redraw_textclock, "redraw textclock") | |
benchmark(e2e_tag_switch, "tag switch") | |
+local function sign(x) | |
+ if x > 0 then |
NewerOlder