Skip to content

Instantly share code, notes, and snippets.

View trxcllnt's full-sized avatar

Paul Taylor trxcllnt

  • NVIDIA, Inc
  • Portland, OR
  • 17:54 (UTC -07:00)
  • X @inlineptx
View GitHub Profile
```const readFile = (...xs) => require('fs').createReadStream(require('path').resolve(...xs));
const tableMerge = require('child_process').spawn('python', ['-c', pymerge()], {
stdio: ['pipe', 'inherit', 'inherit', 'pipe', 'pipe']
});
readFile('./table-1.arrow').pipe(tableMerge.stdio[3]);
readFile('./table-2.arrow').pipe(tableMerge.stdio[4]);
function pymerge() {
return (
if (typeof ReadableStream === 'undefined') {
(() => {
const mozFetch = require('fetch-readablestream');
const streams = require('@mattiasbuelens/web-streams-polyfill');
const { makeXhrTransport } = require('fetch-readablestream/lib/xhr');
const { createReadableStreamWrapper } = require('@mattiasbuelens/web-streams-adapter');
const toPolyfilledReadableStream = createReadableStreamWrapper(streams.ReadableStream);
const defaultFactory = require('fetch-readablestream/lib/defaultTransportFactory').default;
mozFetch.transportFactory = !supportsXhrResponseType('moz-chunked-arraybuffer') ? defaultFactory :
((transport) => () => transport)(makeXhrTransport({
bash << "EOF"
read -p "cmake version (default: 3.15.2): " V </dev/tty
CMAKE_VERSION=$([ -z "${V// }" ] && echo "3.15.2" || echo "$V");
sudo apt install \
curl zlib1g-dev libssl-dev libcurl4-openssl-dev \
&& curl -o ./cmake-${CMAKE_VERSION}.tar.gz \
-L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz \
&& tar -xvzf cmake-${CMAKE_VERSION}.tar.gz \
&& cd cmake-${CMAKE_VERSION} \
&& ./bootstrap --qt-gui --system-curl \
# View registry settings
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
# Restore default scroll direction
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }
@trxcllnt
trxcllnt / config.yml
Created June 7, 2022 02:35
basic `clangd` C/C++/CUDA config
# Apply this config conditionally to all C files
If:
PathMatch: .*\.(c|h)$
CompileFlags:
Compiler: /usr/bin/gcc
---
# Apply this config conditionally to all C++ files
If:
@trxcllnt
trxcllnt / golden-ratio-squares.js
Last active April 19, 2023 04:55
copy and paste this into an `about:blank` JS console
((goldenRatioConjugate = 0.618033988749895) => {
// console.clear();
document.body.style.background = 'gray';
Array.from(document.body.children).forEach((x) => {
document.body.removeChild(x);
});
const cnv = document.body.appendChild(document.createElement('canvas'));
cnv.style.width = '100%';
cnv.style.height = '100%';
cnv.width = window.innerWidth;