Skip to content

Instantly share code, notes, and snippets.

@craigbilner
craigbilner / tsc.js
Created July 23, 2021 15:35
nx executor
const { exec } = require('child_process');
const { promisify } = require('util');
const path = require('path');
module.exports.default = async function tsc(options, context) {
process.chdir(
path.join(context.cwd, context.workspace.projects[context.projectName].root)
);
try {
const fs = require('fs');
fs.readFile('lcov.info', 'utf8', (err, data) => {
const arr = data.split('\n');
let file;
const counts = [];
arr.forEach((a) => {
const fs = require('fs');
// const report = {
// 'foo.tsx': {
// 12: ['foo.spec.tsx', 'bar.spec.tsx'],
// 389: ['bat.spec.tsx']
// }
// };
class reporter {
@craigbilner
craigbilner / part6.elm
Created April 26, 2020 11:56
tjoyt: part 6
Just SomeRecord
|> andMap model.prop1
|> andMap model.prop2
|> andMap model.prop3
@craigbilner
craigbilner / part5.elm
Created April 26, 2020 11:54
tjoyt: part 5
Just SomeRecord
|> foo model.prop1
|> foo model.prop2
|> foo model.prop3
@craigbilner
craigbilner / part4.elm
Created April 26, 2020 11:44
tjoyt: part 4
foo : Maybe a -> Maybe (a -> b) -> Maybe b
foo a b =
Nothing
@craigbilner
craigbilner / part3.elm
Created April 26, 2020 11:43
tjot: part 3
a =
foo model.prop1 (Just SomeRecord)
b =
foo model.prop2 a
c =
foo model.prop3 b
@craigbilner
craigbilner / part2.elm
Created April 26, 2020 11:41
tjot: part 2
foo : Maybe (a -> b) -> Maybe a -> Maybe b
foo a b =
Nothing
@craigbilner
craigbilner / part1.elm
Last active April 26, 2020 11:38
tjot: part 1
a =
 foo (Just SomeRecord) model.prop1
b =
 foo a model.prop2
c =
 foo b model.prop3
@craigbilner
craigbilner / gist:562da84d8fe34cb30446ce838c7c8263
Last active July 17, 2018 11:03
Example TPA article data
{
"data": {
"article": {
"id": "b5df0b22-8870-11e8-a0fd-e428ecc3ac12",
"headline": "Brexit climbdown as Theresa May accepts rebel amendment",
"publicationName": "TIMES",
"publishedTime": "2018-07-16T16:00:00.000Z",
"label": "",
"standfirst":
"Brussels would have to agree to collect tariffs on behalf of the UK",