Skip to content

Instantly share code, notes, and snippets.

@rprichard
rprichard / configure_log.txt
Created April 9, 2016 03:25
tis-interpreter build issue
configure: ******************
configure: * CONFIGURE MAKE *
configure: ******************
checking for make... make
checking version of make... 4.0
configure: *****************************
configure: * CONFIGURE OCAML COMPILERS *
configure: *****************************
checking for ocamlc... ocamlc
checking version of OCaml... 4.01.0
@rprichard
rprichard / showkey.cc
Created June 3, 2016 10:06
Single-file implementation of `showkey -a` for showing terminal input bytes
// Compile with g++ showkey.cc -o showkey
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
static inline char decodeUnixCtrlChar(char ch) {
@rprichard
rprichard / NamedPipeTest.cc
Last active July 31, 2022 08:34
Windows Named Pipe Test (Connection and Disconnection)
// Dedicated to the public domain as per the Creative Commons CC0
// (https://creativecommons.org/about/cc0/).
// Compile with C++11 (i.e. -std=c++11)
// Tests the behavior of Windows named pipes regarding the lifecycle of
// connections.
//
// This test demonstrates various ways that Wine (as of 1.9.12) differs from
// Windows:
@rprichard
rprichard / child.cc
Last active January 4, 2017 22:52
Rust output collection bug
#include <windows.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <vector>
volatile LONG counter = 0;
static DWORD spew(void*) {
@rprichard
rprichard / winchtest.c
Last active April 22, 2017 23:32
SIGWINCH testing for Cygwin and WSL
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
void handler(int signo, siginfo_t *info, void *ctx) {
struct winsize w;
@rprichard
rprichard / BAD-DP-0-nvidia-bug-report.log
Created May 8, 2017 04:47
NVIDIA driver issue with GT 650M, ports DP-0 and DP-1
This file has been truncated, but you can view the full file.
____________________________________________
Start of NVIDIA bug report log file. Please include this file, along
with a detailed description of your problem, when reporting a graphics
driver bug via the NVIDIA Linux forum (see devtalk.nvidia.com)
or by sending email to 'linux-bugs@nvidia.com'.
nvidia-bug-report.sh Version: 21434654
Date: Sun May 7 23:04:32 CDT 2017
@rprichard
rprichard / npm-debug-log (win7-6.10.3).txt
Created May 27, 2017 01:30
Run `npm run watch` in an ordinary console, then close the console
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch' ]
2 info using npm@3.10.10
3 info using node@v6.10.3
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle eslint-server@1.2.1~prewatch: eslint-server@1.2.1
6 silly lifecycle eslint-server@1.2.1~prewatch: no script for prewatch, continuing
@rprichard
rprichard / closetest.cc
Last active July 8, 2017 07:58
Test of Win32 console CTRL_CLOSE_EVENT event delivery
/*
The MIT License (MIT)
Copyright (c) 2017 Ryan Prichard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@rprichard
rprichard / test.c
Created December 12, 2017 05:01
sscanf %l[...] handling
// Copyright 2017 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,