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
profiles: Yup.lazy((value, { parent }) => { | |
if (value && parent.selected_groups?.length) { | |
const newEntries = parent.selected_groups.reduce( | |
(acc, val) => ({ | |
...acc, | |
[val]: Yup.string().test("hasValue", "item cannot be empty", (value) => { | |
return !!value; | |
}), | |
}), | |
{} |
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
export const TextField = ({name}) => { | |
const { touched, values, errors, handleBlur, handleChange } = useFormikContext(); | |
const isTouched = getIn(touched, name); | |
const value = getIn(values, name); | |
const error = getIn(errors, name); | |
// getIn automates for you getting values["text"][0] | |
const isTouched = getIn(touched, name); | |
const value = getIn(values, name); |
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 PropTypes from "prop-types"; | |
import { useCallback, useMemo, useState } from "react"; | |
import Table from "@mui/material/Table"; | |
import TableBody from "@mui/material/TableBody"; | |
import TableCell from "@mui/material/TableCell"; | |
import TableHead from "@mui/material/TableHead"; | |
import TableRow from "@mui/material/TableRow"; | |
import TableSortLabel from "@mui/material/TableSortLabel"; | |
import Box from "@mui/material/Box"; |
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
// disables weird keyboard behaviours in mac ~/Library/KeyBindings/DefaultKeyBinding.dict | |
{ | |
"\UF729" = moveToBeginningOfLine:; // home | |
"\UF72B" = moveToEndOfLine:; // end | |
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home | |
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end | |
"@\UF700" = noop:; // command-up | |
"@\UF701" = noop:; // command-down | |
"$@\UF700" = noop:; // shift-command-up | |
"$@\UF701" = noop:; // shift-command-down |
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 os, glob | |
import shutil | |
import string | |
# generates RLOADER https://github.com/marco-sacchi/RLoader LIST.txr | |
translation_table = dict.fromkeys(map(ord, ' [](),.~!@#$%^&*{}: '), None) | |
OUT = "/Users/jordism/Downloads/DOS/GAMES" | |
ROOT = ["./DIST/games1", | |
"./games2", | |
"./games3"] |
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 os, glob | |
import shutil | |
import string | |
translation_table = dict.fromkeys(map(ord, ' [](),.~!@#$%^&*{}: '), None) | |
# todo use argparse to parametrize | |
OUT = "./games" | |
ROOT = ["./DIST/games1", | |
"./DIST/games2", | |
"./DIST/games3"] |
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
sudo open /System/Library/CoreServices/KeyboardSetupAssistant.app/Contents/MacOS/KeyboardSetupAssistant |
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 botocore.session | |
from botocore import monitoring | |
from opentelemetry.trace import get_tracer | |
from opentelemetry import trace | |
from opentelemetry.trace import SpanKind | |
from opentelemetry.semconv.trace import SpanAttributes | |
from opentelemetry.trace.status import Status, StatusCode | |
from opentelemetry.instrumentation.utils import ( | |
http_status_to_status_code, | |
) |
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 [lastVisit, setLastVisit] = useState(null); | |
useEffect( | |
() => | |
history.listen((e) => { | |
logEvent(TrackEvents.PAGE_VISIT, { route: e.pathname }); | |
const now = Date.now() / 1000; | |
lastVisit && | |
logEvent(TrackEvents.PAGE_LEAVE, { | |
route: lastVisit.path, |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"io/ioutil" | |
) | |
import "github.com/thrift-iterator/go" | |
import "github.com/thrift-iterator/go/general" |
NewerOlder