This file contains hidden or 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
// everything works totally correctly with this version | |
export function test< | |
P extends Props | |
>(input: unknown, innerCodec: TypeC<P>) { | |
return innerCodec.is(input) // no errors | |
} | |
// no errors within this function, but where the function is called such as | |
// | |
// test({}, someCodec) |
This file contains hidden or 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 React from "react"; | |
import { sortWith, compose, filter, propEq, propIs } from "ramda"; | |
import { Formik, Form, Field } from "formik"; | |
import Box from "@material-ui/core/Box"; | |
import Button from "@material-ui/core/Button"; | |
import Check from "@material-ui/icons/Check"; | |
import Checkbox from "@material-ui/core/Checkbox"; | |
import Clear from "@material-ui/icons/Clear"; | |
import Dialog from "@material-ui/core/Dialog"; | |
import DialogActions from "@material-ui/core/DialogActions"; |
This file contains hidden or 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
{ | |
"slump": { | |
"name": "slump", | |
"title": "Slump", | |
"data": "{\"slump\":[{\"title\":\"80\",\"value\":80,\"price\":0},{\"title\":\"90\",\"value\":90,\"price\":0}]}" | |
} | |
"agg": { | |
"name": "agg", | |
"title": "Agg", | |
"data": "{\"slump\":[{\"title\":\"80\",\"value\":80,\"price\":0},{\"title\":\"90\",\"value\":90,\"price\":0}]}" |
This file contains hidden or 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
INSERT INTO customers (primary_contact_id, company_name, created_at, updated_at) | |
SELECT user_id, account_name, current_timestamp as the_timestamp FROM account_named_users | |
VALUES (user_id, account_name, the_timestamp, the_timestamp); | |
-- ERROR: table "values" has 2 columns available but 4 columns specified |
This file contains hidden or 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
class DoThing | |
include Dry::Monads::Result::Mixin | |
include Dry::Monads::Do.for(:call) | |
Context = Struct.new(:user, :params, :accumulator) | |
Result = Struct.new(:output) | |
Error = Struct.new(:step, :errors) | |
def call(input) | |
context = yield railway(Context.new(input[:user], input[:params], {})) |
This file contains hidden or 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
class DoThing | |
include Dry::Transaction | |
Context = Struct.new(:user, :params, :accumulator) | |
Result = Struct.new(:output) | |
Error = Struct.new(:step, :errors) | |
step :build_context | |
step :operation_one | |
step :operation_two |
This file contains hidden or 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
/* Keymap 0: Basic layer | |
* | |
* ,--------------------------------------------------. ,--------------------------------------------------. | |
* | Esc | 1 | 2 | 3 | 4 | 5 | LEFT | | DEL | 6 | 7 | 8 | 9 | 0 | BSpace | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | |
* | Tab | ' | , | . | P | Y | / | | PgUp | F | G | C | R | L | \ | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | |
* | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S | ENT | | |
* |--------+------+------+------+------+------| _ | | PgDn |------+------+------+------+------+--------| | |
* | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | |
This file contains hidden or 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 { h, init } from 'snabbdom'; | |
import classModule from 'snabbdom/modules/class'; | |
import propsModule from 'snabbdom/modules/props'; | |
import styleModule from 'snabbdom/modules/style'; | |
import eventModule from 'snabbdom/modules/eventlisteners'; | |
// Init patch function with chosen modules | |
const patch = init([ | |
classModule, // makes it easy to toggle classes |
This file contains hidden or 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
$ yarn run tsc | |
yarn run v1.12.3 | |
$ /home/quazi/Filing/app/node_modules/.bin/tsc | |
error TS2688: Cannot find type definition file for 'react-native'. | |
Found 1 error. | |
error Command failed with exit code 2. | |
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
This file contains hidden or 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 function mix< | |
COMB extends { | |
[CS in keyof ComponentSinks]?: (arg: { | |
[K in keyof COMPONENTS]: Stream<any> | |
}) => ComponentSinks[CS] | |
}, | |
COMPONENTS extends { | |
[COMPNAME in keyof COMPONENTS]: { | |
[SINKNAME in keyof ComponentSinks]?: (COMB[SINKNAME] extends (arg: infer STREAMS) => any ? ( | |
COMPNAME extends keyof STREAMS ? STREAMS[COMPNAME] : ComponentSinks[SINKNAME] |