Skip to content

Instantly share code, notes, and snippets.

// Name: Eject External Drive
import "@johnlindquist/kit"
import os from 'os'
const {stdout} = await $`diskutil list | grep "(external"`
const firstDisk = stdout.split(os.EOL)[0]
const firstDiskPath = firstDisk.split(' ')[0]
// Name: Eject External Drive
import "@johnlindquist/kit"
import os from 'os'
const {stdout} = await $`diskutil list | grep "(external"`
const firstDisk = stdout.split(os.EOL)[0]
const firstDiskPath = firstDisk.split(' ')[0]
// Name: Eject External Drive
import "@johnlindquist/kit"
import os from 'os'
const {stdout} = await $`diskutil list | grep "(external"`
const firstDisk = stdout.split(os.EOL)[0]
const firstDiskPath = firstDisk.split(' ')[0]
@ohana54
ohana54 / Pom.re
Created July 31, 2019 16:19 — forked from mrmurphy/Pom.re
type pomWithError('data, 'err) = Js.Promise.t(Result.t('data, 'err));
type pom('data) = pomWithError('data, unit);
module JsPromise = {
let make = () => {
let resolver = ref(ignore);
let p =
Js.Promise.make((~resolve, ~reject as _) =>
resolver := (a => resolve(. a))
);
// Simplified version of the current code
getProp('componentRef').matchWith({
Nothing: () => report('bad payload'),
Just: ({ value: componentRef }) => {
getComponentType(getProp).matchWith({
Nothing: () => report('no component type'),
Just: ({ value: componentType }) =>
reduceMaybes([
connectonConfigSettings.getPanelTitle(componentType),
connectonConfigSettings.getPanelHeight(componentType),
describe('keepAtBottom', function () {
describe('when false', function () {
it('should not scroll to bottom if the scroll is at the bottom', function () {
});
});
describe('when true', function () {
describe('when content is added', function () {
it('should automatically scroll to bottom if the scroll is at the bottom', function () {
import _ from 'lodash';
import fetch from 'node-fetch';
import delay from 'delay';
import co from 'co';
export const pingServers = (servers) => co(function*() {
let failedServers = {};
for (const url of servers) {
let failures = 0;
for (const i of _.range(3)) {