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
/* | |
* Copyright 2009-2011 Mozilla Foundation and contributors | |
* Licensed under the New BSD license. See LICENSE.txt or: | |
* http://opensource.org/licenses/BSD-3-Clause | |
*/ | |
/** | |
* Define a module along with a payload. | |
* @param moduleName Name for the payload |
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
// @ts-check | |
import { readFile } from 'fs/promises'; | |
import { Client } from 'ssh2'; | |
import { ProcessPromise, ProcessOutput, $ } from 'zx'; | |
import chalk from 'chalk'; | |
/** | |
* @typedef {import('ssh2/lib/Channel.js').Channel} Channel)} | |
* @typedef {import('./ssh-types').HostConfig} HostConfig | |
* @typedef {import('./ssh-types').SshZx} SshZx |
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
/* Any copyright is dedicated to the Public Domain. | |
* http://creativecommons.org/publicdomain/zero/1.0/ */ | |
Components.utils.import("resource:///modules/devtools/gcli.jsm"); | |
var helloCommandSpec = { | |
name: 'hello', | |
description: 'Show a message', | |
params: [ | |
{ |
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
// @flow | |
type FlatMapMapper<In, Out> = (elem: In, index: number, arr: In[]) => Out | Out[]; | |
function flatMap<In, Out>(arr: In[], mapFunc: FlatMapMapper<In, Out>): Out[] { | |
const result = []; | |
for (const [ index, elem ] of arr.entries()) { | |
const x = mapFunc(elem, index, arr); | |
// We allow mapFunc() to return non-Arrays | |
if (Array.isArray(x)) { |
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
; $ cd .../datomish | |
; lein repl | |
(require '[datomish.api :as d]) | |
(require '[datomish.sqlite]) | |
(require '[datomish.jdbc-sqlite]) | |
(require '[clojure.core.async :as async]) | |
; You'll need to replace $HOME with whatever $HOME is, and if not on a mac, do something AppData like |
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
import webpack from 'webpack'; | |
import config from './webpack.config'; | |
import { mapObject } from './web/util/util'; | |
export const original = config; | |
/** | |
* Development config. Inspired by | |
* https://github.com/gaearon/react-transform-boilerplate/blob/master/webpack.config.dev.js |
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
import webpack from 'webpack'; | |
import config from './webpack.config'; | |
import { mapObject } from './web/util/util'; | |
export const original = config; | |
/** | |
* Development config. Inspired by | |
* https://github.com/gaearon/react-transform-boilerplate/blob/master/webpack.config.dev.js |
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
XPCOMUtils.defineLazyGetter(this, "require", function() { | |
let { require } = Cu.import("resource://gre/modules/devtools/Require.jsm", {}); | |
Cu.import("resource://gre/modules/devtools/gcli.jsm", {}); | |
return require; | |
}); | |
XPCOMUtils.defineLazyGetter(this, "Requisition", () => require("gcli/cli").Requisition); | |
function execGcliCommand(command) { |
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
/** | |
* An example of the new way to write GCLI tests | |
*/ | |
var promise = helpers.audit([ // Tests can be async. They're done when the promise resolves | |
{ | |
name: 'a test', // Optional test name, we'll use the 'setup' string if there is no name | |
setup: 'help search', // A string to type (which can include control chars like <TAB>), | |
// or a function to do custom setup. return a promise to be async | |
skipIf: function() { ... }, // If you need to skip tests in some cases e.g. private browsing | |
check: { // Some stuff to check ... |
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
let console = (Cu.import("resource://gre/modules/devtools/Console.jsm", {})).console; | |
// ... | |
/** | |
* Internal utility: Decorates given `f` function, so that on exception promise | |
* rejected with thrown error is returned. | |
*/ | |
function attempt(f) { | |
return function effort(input) { |
NewerOlder