Skip to content

Instantly share code, notes, and snippets.

View zindel's full-sized avatar

Oleksiy Golovko zindel

  • Prague, The Czech Republic
View GitHub Profile
ret = box([1,2,3]) >> mapU(lambda x: x * x) >> unbox
print ret
# [1, 4, 9]
print (box() >> mapU(lambda x: x * x) >> unbox)
# None
print (box({"some": "dict"}) >> mapU(lambda x: x * x) >> unbox)
# TypeError
fhir = box()
fhir.resourceType = 'Condition'
# {"resourceType": "Condition"}
fhir.id = identifier.value(table='condition_occurrence',
code=condition.condition_occurrence_id)
fhir.verificationStatus = 'unknown'
fhir.clinicalStatus = 'inactive' if condition.end_date else 'inactive'
fhir.subject = identifier.ref(resource_type='Patient',
table='person',
code=condition.person_id)
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|mjs|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
it('does execute scripts in a non-root package scope', async () => {
const p = await createTestSandbox(...fixture);
await p.esy('install');
await p.esy('build');
await expect(p.esy('-p dep cmd1')).rejects.toMatchObject({
message: expect.stringMatching('error: unable to resolve command: cmd1'),
});
});
@zindel
zindel / esy.re
Last active March 26, 2019 12:48
let runScriptCli = (cmd, proj: Project.t) => {
open RunAsync.Syntax;
let%bind fetched = Project.fetched(proj);
let script = Cmd.getTool(cmd);
switch (Scripts.find(script, proj.scripts)) {
| Some(script) => runScript(script, Cmd.getArgs(cmd), proj)
| None => errorf("Script '%s' not found", script)
};
};
module type Impl = {
let startProcess: string => Lwt.t(result(Process.t, string));
let getFiles: Process.t => Lwt.t(list(string));
};
module Backend = (Impl: Impl) => {
type t = {
root: string,
process: Process.t,
/.../test/error-resolve-case-sensitive/index.js
Cannot resolve './badCase.js'
File can be found on the filesystem by the requsted name, but doesn't match exactly (case sensitive). This is usually the sign that your module request is not accurate.
Directory '/.../test/error-resolve-case-sensitive' contains potentially matching files:
BadCase.js
Resolving './badCase.js'. Base directory: '/.../test/error-resolve-case-sensitive'
Resolving '/.../test/error-resolve-case-sensitive/badCase.js'.
"resolutions": {
"@esy-ocaml/reason":
"github:facebook/reason#335c3fb2470964c2b4a7d571a8fbd9acdc3c2323",
"@esy-ocaml/reason":
"github:facebook/reason#335c3fb2470964c2b4a7d571a8fbd9acdc3c2323",
"@esy-ocaml/esy-installer": "0.0.1"
},
let resolveDeps = fix (fun recur ->
let%bind _js, reqs = File.compute >>> parse in
let%bind deps = return reqs ||> resolve in
let%bind depsOfDeps = return deps ||> recur in
return (deps @ List.flatten depsOfDeps)
) in
import Data.Char
import qualified Data.Map as M
import qualified Data.Set as S
data Claim = Claim { elfId :: Int
, left :: Int
, top :: Int
, width :: Int
, height :: Int
}