made with esnextbin
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
((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; |
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
# 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: |
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
# 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 } |
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
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 \ |
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
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({ |
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
```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 ( |
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
// const memwatch = require('memwatch-next'); | |
// require('segfault-handler').registerHandler("async.log"); | |
// memwatch.on('leak', ({ growth, reason }) => console.log(`Leak: ${round(growth >> 10, 2)}mb ${reason}`)); | |
let eventID = 0; | |
const assert = require('assert'); | |
const cl = require('node-opencl'); | |
const { promisify } = require('util'); | |
const sleep = promisify(setTimeout); | |
const MemoryPool = createMemoryPoolClass(); |
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 JavaScript implementation of the non-blocking RotatingSkipList algorithm described in: | |
Dick, I. Fekete, A. Gramoli, V. (2016) | |
"A Skip List for Multicore", to appear in | |
Concurrency and Computation Practice and Experience 2016 | |
http://poseidon.it.usyd.edu.au/~gramoli/web/doc/pubs/rotating-skiplist-preprint-2016.pdf | |
https://github.com/gramoli/synchrobench/blob/master/c-cpp/src/skiplists/rotating/nohotspot_ops.c | |
*/ |
made with esnextbin
NewerOlder