Skip to content

Instantly share code, notes, and snippets.

@prumand
prumand / test.tsx
Created January 17, 2024 17:37
Making my head hurt
import { createContext, useContext } from 'react';
import { MessagesContext } from '../messages/MessagesContext';
import { getDataFromMessage } from '../messages/messenger';
type DbContextValue = {
getContexts: () => Promise<{
name: string,
active: boolean
}[]>
};
@prumand
prumand / prepend-empty-lines.js
Created February 28, 2020 11:54
Prepend empty lines to existing source-map
#!/usr/bin/env node
const sourceMap = require('source-map')
const fs = require('fs')
const path = require('path')
/**
* Prepend six lines to source-map
*/
const runSourceMapPrepend = async (sourceMapFile) => {
const sourceMapFileContent = fs.readFileSync(sourceMapFile, 'utf8')
@prumand
prumand / run-io-tests.sh
Last active June 26, 2017 14:56
script for I/O tests on dev-servers
#!/bin/bash
set -e
TEST_SUITES=(read rw randread randrw)
TEST_FILE_PRE=fio_
TEST_FILE_POST=.json
function set_filename {
FILENAME=${TEST_FILE_PRE}${1}${TEST_FILE_POST}
}