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
type ITask<I: $ReadOnlyArray<mixed>, O> = { | |
(...r: I): ?O, | |
lastError?: Error | |
} | |
function task <I: $ReadOnlyArray<mixed>, O>(inner: (...r: I) => O): ITask<I, O> { | |
const wrapped: any = function wrapped() { | |
try { | |
return (inner: any).apply(this, arguments) | |
} catch (err) { |
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 | |
/* | |
This magic type will give you the union of the types of all the values in an object type. | |
This is still far from a fully dynamic $PropertyType, but it's a lot better than just using `any` | |
*/ | |
/* | |
Link: | |
https://flow.org/try/#0C4TwDgpgBAJA8gIwFYQMbADwDUB8UC8UA3gNQDaA1hCAFxQDOwATgJYB2A5gLp1YC+AKFCQoAfRhYAhgBsArhHrYANFDh14yNJlx5CWIeGgSZ8xWtWb0uscbkKMAKhVwcAt8OiIkBYgKhQSVDo2WQBbBAgmJT8AhDpGVk5o-xJJOgQAewzpCEk2aMEBABM0aUkmaAA3cqhaWCk7M2RXAG4ACjqE9g4oAB8oTOzctj6oEPDIgEo3AHoZ9rqAQSYmSRAMcYimHEmoOagAURWMpgYACwyAdxHUE4r0aRAoM8iIATmF4LCt0a7OXf2RyYJ3OVxudy0j2er3e8w6XwmTABM0Ox1O9Au1ygtxWkKeLwqsM+AyyOTyyNRwPRmPBuIe+JhH3hDGY3QpQJBGLB2Ih9OhhKAA | |
*/ |
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 $Function1<A, B> = (arg: A) => B; | |
type _Function1Value<A, B, F: $Function1<A, B>> = B; // eslint-disable-line | |
type $Function1Value<F: $Function1<*, *>, A> = _Function1Value<A, *, F>; | |
var toString = (value) => String(value) | |
var toNumber = (value) => parseFloat(value) || 0 | |
type NumberXString = ((value: number) => string) & ((value: string) => number) |
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
// ==UserScript== | |
// @name Call Form Editable Still | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make all View Buttons Edit Buttons | |
// @author You | |
// @match https://ic.bdsmarketing.com/IC.DataCollection/HoursCollection.aspx* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Call Form Editable Still | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make all View Buttons Edit Buttons | |
// @author You | |
// @match https://ic.bdsmarketing.com/IC.DataCollection/HoursCollection.aspx* | |
// @grant none | |
// ==/UserScript== |
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
#!/usr/bin/env bash | |
# install Xcode Command Line Tools | |
# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh | |
# touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; | |
# PROD=$(softwareupdate -l | | |
# grep "\*.*Command Line" | | |
# head -n 1 | awk -F"*" '{print $2}' | | |
# sed -e 's/^ *//' | | |
# tr -d '\n') |
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 Range = { | |
start: number; | |
end: number; | |
+length: number; | |
}; | |
declare var Paragraph: TParagraph; |
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
const exprs = | |
pathUtils.isTemplateLiteral(path) ? path.get('expressions') | |
: pathUtils.isTaggedTemplateExpression(path) ? | |
path.get('quasi').get('expressions') | |
: []; | |
// I would want that formated as: | |
const exprs = | |
pathUtils.isTemplateLiteral(path) ? | |
path.get('expressions') |
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
const header = | |
useLayers ? | |
'\n@layer ' + | |
grouped.map((_, index) => `priority${index + 1}`).join(', ') + | |
';\n' | |
: ''; | |
return useLayers ? | |
`@layer priority${index + 1}{\n${collectedCSS}\n}` | |
: collectedCSS; |
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 * as stylex from '@stylexjs/stylex' | |
export default stylex.create({ | |
sr_only: { | |
position: 'absolute', | |
width: 1, | |
height: 1, | |
padding: 0, | |
margin: -1, | |
overflow: 'hidden', |
OlderNewer